- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 68 for exhaust (0.07 sec)
-
okhttp/src/jvmTest/kotlin/okhttp3/ResponseBodyJvmTest.kt
fun readerEmpty() { val body = body("") assertThat(exhaust(body.charStream())).isEqualTo("") } @Test fun readerLooksLikeBomButTooShort() { val body = body("000048") assertThat(exhaust(body.charStream())).isEqualTo("\u0000\u0000H") } @Test fun readerDefaultsToUtf8() { val body = body("68656c6c6f") assertThat(exhaust(body.charStream())).isEqualTo("hello") } @Test
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 12.4K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/io/CharStreamsTest.java
Reader reader = new StringReader(ASCII); assertEquals(ASCII.length(), CharStreams.exhaust(reader)); assertEquals(-1, reader.read()); assertEquals(0, CharStreams.exhaust(reader)); Reader empty = new StringReader(""); assertEquals(0, CharStreams.exhaust(empty)); assertEquals(-1, empty.read()); } public void testExhaust_readable() throws IOException {
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 18:46:00 UTC 2025 - 11.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/io/CharStreamsTest.java
Reader reader = new StringReader(ASCII); assertEquals(ASCII.length(), CharStreams.exhaust(reader)); assertEquals(-1, reader.read()); assertEquals(0, CharStreams.exhaust(reader)); Reader empty = new StringReader(""); assertEquals(0, CharStreams.exhaust(empty)); assertEquals(-1, empty.read()); } public void testExhaust_readable() throws IOException {
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 18:46:00 UTC 2025 - 11.3K bytes - Viewed (0) -
guava/src/com/google/common/io/CharStreams.java
* Returns the total number of chars read. Does not close the stream. * * @since 20.0 */ @CanIgnoreReturnValue public static long exhaust(Readable readable) throws IOException { long total = 0; long read; CharBuffer buf = createBuffer(); while ((read = readable.read(buf)) != -1) { total += read;
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Wed Jul 30 17:25:01 UTC 2025 - 10.9K bytes - Viewed (0) -
okhttp-idna-mapping-table/src/main/kotlin/okhttp3/internal/idn/SimpleIdnaMappingTable.kt
internal const val TYPE_VALID = 6 private fun BufferedSource.skipWhitespace() { while (!exhausted()) { if (buffer[0] != ' '.code.toByte()) return skip(1L) } } private fun BufferedSource.skipRestOfLine() { when (val newline = indexOf('\n'.code.toByte())) { -1L -> skip(buffer.size) // Exhaust this source. else -> skip(newline + 1) } } /**
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 6.8K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/-UtilJvm.kt
timeout().deadlineNanoTime(nowNs + originalDurationNs) } } } @Throws(IOException::class) internal fun BufferedSource.skipAll() { while (!exhausted()) { skip(buffer.size) } } /** * Attempts to exhaust this, returning true if successful. This is useful when reading a complete * source is helpful, such as when doing so completes a cache body or frees a socket connection for * reuse. */
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Jul 31 04:18:40 UTC 2025 - 10.2K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/io/BaseEncodingTest.java
// See https://github.com/google/guava/issues/3542 Reader reader = new StringReader(cannotDecode); InputStream decodingStream = encoding.decodingStream(reader); try { ByteStreams.exhaust(decodingStream); fail("Expected DecodingException"); } catch (DecodingException expected) { // Don't assert on the expectedMessage; the messages for exceptions thrown from the
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 24.7K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache/CacheInterceptor.kt
} /** * Returns a new source that writes bytes to [cacheRequest] as they are read by the source * consumer. This is careful to discard bytes left over when the stream is closed; otherwise we * may never exhaust the source stream and therefore not complete the cached response. */ @Throws(IOException::class) private fun cacheWritingResponse( cacheRequest: CacheRequest?, response: Response, ): Response {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 10.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/io/BaseEncodingTest.java
// See https://github.com/google/guava/issues/3542 Reader reader = new StringReader(cannotDecode); InputStream decodingStream = encoding.decodingStream(reader); try { ByteStreams.exhaust(decodingStream); fail("Expected DecodingException"); } catch (DecodingException expected) { // Don't assert on the expectedMessage; the messages for exceptions thrown from the
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 24.7K bytes - Viewed (0) -
android/guava/src/com/google/common/io/ByteSource.java
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Mar 20 20:55:20 UTC 2025 - 25.7K bytes - Viewed (0)