Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 52 for readUTF8 (0.05 sec)

  1. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/RecordedRequest.kt

      val handshake: Handshake?
      val requestUrl: HttpUrl?
    
      @get:JvmName("-deprecated_utf8Body")
      @Deprecated(
        message = "Use body.readUtf8()",
        replaceWith = ReplaceWith("body.readUtf8()"),
        level = DeprecationLevel.ERROR,
      )
      val utf8Body: String
        get() = body.readUtf8()
    
      val tlsVersion: TlsVersion?
        get() = handshake?.tlsVersion
    
      internal constructor(
        requestLine: String,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/url/-Url.kt

            alreadyEncoded = alreadyEncoded,
            strict = strict,
            plusIsSpace = plusIsSpace,
            unicodeAllowed = unicodeAllowed,
            charset = charset,
          )
          return out.readUtf8()
        }
        i += Character.charCount(codePoint)
      }
    
      // Fast path: no characters in [pos..limit) required encoding.
      return substring(pos, limit)
    }
    
    internal fun Buffer.writePercentDecoded(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http/HttpHeaders.kt

        if (i == -1L) return null // Unterminated quoted string.
    
        if (this[i] == '"'.code.toByte()) {
          result.write(this, i)
          // Consume '"'.
          readByte()
          return result.readUtf8()
        }
    
        if (size == i + 1L) return null // Dangling escape.
        result.write(this, i)
        // Consume '\'.
        readByte()
        result.write(this, 1L) // The escaped character.
      }
    }
    
    /**
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon May 05 16:01:00 UTC 2025
    - 7.2K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/FormBodyTest.kt

        body.writeTo(out)
        assertThat(out.readUtf8()).isEqualTo(expected)
      }
    
      @Test
      fun encodedPair() {
        val body =
          FormBody
            .Builder()
            .add("sim", "ple")
            .build()
        val expected = "sim=ple"
        assertThat(body.contentLength()).isEqualTo(expected.length.toLong())
        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
      }
    
      @Test
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/WebPlatformToAsciiData.kt

          val path = okHttpRoot / "okhttp/src/jvmTest/resources/web-platform-test-toascii.json"
          return SYSTEM_FILE_SYSTEM.read(path) {
            Json.decodeFromString<List<WebPlatformToAsciiData>>(readUtf8())
          }
        }
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/RequestBodyTest.kt

      fun testFileDescriptorRead() {
        assertOnFileDescriptor(content = "Hello") { fd ->
          val requestBody = fd.toRequestBody()
    
          val buffer = Buffer()
          requestBody.writeTo(buffer)
          assertThat(buffer.readUtf8()).isEqualTo("Hello")
        }
      }
    
      @Test
      fun testFileDescriptorDefaultMediaType() {
        assertOnFileDescriptor { fd ->
          val requestBody = fd.toRequestBody()
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 3.6K bytes
    - Viewed (1)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/PostPath.kt

          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          fileSystem.sink(path).use {
            response.body.source().readAll(it)
          }
    
          println(fileSystem.source(path).buffer().readUtf8())
        }
      }
    
      companion object {
        val MEDIA_TYPE_JSON = "application/json".toMediaType()
      }
    }
    
    fun main() {
      PostPath().run()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  8. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/ws/WebSocketReader.kt

              throw ProtocolException("Malformed close payload length of 1.")
            } else if (bufferSize != 0L) {
              code = controlFrameBuffer.readShort().toInt()
              reason = controlFrameBuffer.readUtf8()
              val codeExceptionMessage = WebSocketProtocol.closeCodeExceptionMessage(code)
              if (codeExceptionMessage != null) throw ProtocolException(codeExceptionMessage)
            }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 22:04:11 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  9. src/test/java/org/codelibs/core/io/FileUtilTest.java

            assertThat(bytes, is("あいうえお".getBytes("UTF-8")));
        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testReadUTF8() throws Exception {
            assertThat(FileUtil.readUTF8(getPath("hoge_utf8.txt")), is("あ"));
        }
    
        private String getPath(final String fileName) {
            return getClass().getName().replace('.', '/').replaceFirst(getClass().getSimpleName(), fileName);
        }
    
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Sat May 10 01:32:17 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/core/io/FileUtil.java

         *
         * @param path
         *            The path. Must not be {@literal null} or empty.
         * @return The text read from the file.
         */
        public static String readUTF8(final String path) {
            assertArgumentNotEmpty("path", path);
            return readText(path, UTF8);
        }
    
        /**
         * Reads text from a file in UTF-8 encoding.
         *
         * @param file
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Thu Jul 31 08:16:49 UTC 2025
    - 8.8K bytes
    - Viewed (0)
Back to top