- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 17 for readUtf8 (0.08 sec)
-
okhttp/src/test/java/okhttp3/MultipartReaderTest.kt
"abc", ), ) assertThat(partAbc.body.readUtf8()).isEqualTo("abcd\r\nefgh") val partIjk = parts.nextPart()!! assertThat(partIjk.headers).isEqualTo( headersOf( "Content-Type", "text/plain; charset=utf-8", "Content-ID", "ijk", ), ) assertThat(partIjk.body.readUtf8()).isEqualTo("ijkl\r\nmnop\r\n") assertThat(parts.nextPart()).isNull()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 13.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/MultipartBodyTest.kt
val buffer = Buffer() body.writeTo(buffer) assertThat(body.contentLength()).isEqualTo(buffer.size) assertThat(buffer.readUtf8()).isEqualTo(expected) val buffer2 = Buffer() body.writeTo(buffer2) assertThat(body.contentLength()).isEqualTo(buffer2.size) assertThat(buffer2.readUtf8()).isEqualTo(expected) } @Test fun writeTwiceWithOneShot() { val expected = """ |--123
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.4K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt
val call = client.newCall(request) call.timeout().timeout(250, TimeUnit.MILLISECONDS) val response = call.execute() Thread.sleep(500) assertFailsWith<IOException> { response.body.source().readUtf8() }.also { expected -> assertThat(expected.message).isEqualTo("timeout") assertThat(call.isCanceled()).isTrue() } } @Test fun timeoutReadingResponseWithEnqueue() {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.5K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt
} // 2. Normalize, from bufferB to bufferA. val normalized = normalizeNfc(bufferB.readUtf8()) bufferA.writeUtf8(normalized) // 3. For each label, convert/validate Punycode. val decoded = Punycode.decode(bufferA.readUtf8()) ?: return null // 4.1 Validate. // Must be NFC. if (decoded != normalizeNfc(decoded)) return null
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 11.2K bytes - Viewed (0) -
okhttp/src/main/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 Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 9.8K bytes - Viewed (0) -
okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerReader.kt
} return result.readUtf8() } fun readRelativeObjectIdentifier(): String { val result = Buffer() val dot = '.'.code.toByte().toInt() while (byteCount < limit) { if (result.size > 0) { result.writeByte(dot) } result.writeDecimalLong(readVariableLengthLong()) } return result.readUtf8() }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.5K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/InterceptorTest.kt
.get() .build() client.newCall(request).execute() val recordedRequest = server.takeRequest() assertThat(recordedRequest.method).isEqualTo("POST") assertThat(recordedRequest.body.readUtf8()).isEqualTo("abc") } @Test fun applicationInterceptorsRewriteRequestToServer() { rewriteRequestToServer(false) } @Test fun networkInterceptorsRewriteRequestToServer() {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 14 10:20:09 UTC 2024 - 27.8K bytes - Viewed (0) -
mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt
assertThat(headersToList(builder)).containsExactly("Content-Length: 3") val response = builder.build() val body = Buffer() response.body!!.writeTo(body) assertThat(body.readUtf8()).isEqualTo("ABC") } @Test fun mockResponseAddHeader() { val builder = MockResponse.Builder() .clearHeaders() .addHeader("Cookie: s=square")
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 23.5K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt
assertThat(source.readByte() and 0xff).isEqualTo(0xef) assertThat(source.readByte() and 0xff).isEqualTo(0xbb) assertThat(source.readByte() and 0xff).isEqualTo(0xbf) assertThat(source.readUtf8()).isEqualTo("hello") } @Test fun bytesEmpty() { val body = body("") assertThat(body.bytes().size).isEqualTo(0) } @Test fun bytesSeesBom() {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon May 13 13:42:37 UTC 2024 - 13K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/UrlComponentEncodingTester.kt
for (i in 0 until utf8.size) { percentEncoded.writeUtf8("%") .writeUtf8(ByteString.of(utf8[i]).hex().uppercase()) } return percentEncoded.readUtf8() } }, /** URLs that contain this character in this component are invalid. */ FORBIDDEN, /** Hostnames that contain this character are encoded with punycode. */ PUNYCODE,
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 12.3K bytes - Viewed (0)