Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for byteStream (0.23 sec)

  1. okhttp/src/main/kotlin/okhttp3/ResponseBody.kt

     * [bytes] or [string]. Or stream the response with either [source], [byteStream], or [charStream].
     */
    abstract class ResponseBody : Closeable {
      /** Multiple calls to [charStream] must return the same instance. */
      private var reader: Reader? = null
    
      abstract fun contentType(): MediaType?
    
      /**
       * Returns the number of bytes in that will returned by [bytes], or [byteStream], or -1 if
       * unknown.
       */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

          )
        }
      }
    
      @Test
      fun byteStreamEmpty() {
        val body = body("")
        val bytes = body.byteStream()
        assertThat(bytes.read()).isEqualTo(-1)
      }
    
      @Test
      fun byteStreamSeesBom() {
        val body = body("efbbbf68656c6c6f")
        val bytes = body.byteStream()
        assertThat(bytes.read()).isEqualTo(0xef)
        assertThat(bytes.read()).isEqualTo(0xbb)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/http2/HpackTest.kt

          ),
        )
      }
    
      @Test
      fun readSingleByteInt() {
        assertThat(newReader(byteStream()).readInt(10, 31)).isEqualTo(10)
        assertThat(newReader(byteStream()).readInt(0xe0 or 10, 31)).isEqualTo(10)
      }
    
      @Test
      fun readMultibyteInt() {
        assertThat(newReader(byteStream(154, 10)).readInt(31, 31)).isEqualTo(1337)
      }
    
      @Test
      fun writeSingleByteInt() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 38.2K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt

            .build(),
        )
        val call = client.newCall(Request(server.url("/")))
        val response = call.execute()
        cancelLater(call, 500)
        val responseBody = response.body.byteStream()
        val buffer = ByteArray(1024)
        assertFailsWith<IOException> {
          while (responseBody.read(buffer) != -1) {
          }
        }.also { expected ->
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

            override fun contentLength(): Long = TODO()
    
            override fun source(): BufferedSource = TODO()
    
            override fun close() = TODO()
          }
        val byteStream = responseBody.byteStream()
        val source = responseBody.source()
        val bytes = responseBody.bytes()
        val charStream = responseBody.charStream()
        val string = responseBody.string()
        responseBody.close()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  6. android/guava/src/com/google/common/io/ByteStreams.java

     *
     * @author Chris Nokleberg
     * @author Colin Decker
     * @since 1.0
     */
    @J2ktIncompatible
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    public final class ByteStreams {
    
      private static final int BUFFER_SIZE = 8192;
    
      /** Creates a new byte array for buffering reads or writes. */
      static byte[] createBuffer() {
        return new byte[BUFFER_SIZE];
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jan 17 18:59:58 GMT 2024
    - 29.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

            NullPointerException.class, () -> ByteStreams.readFully(newTestStream(10), null, 0, 10));
    
        assertThrows(NullPointerException.class, () -> ByteStreams.readFully(null, b, 0, 10));
    
        assertThrows(
            IndexOutOfBoundsException.class, () -> ByteStreams.readFully(newTestStream(10), b, -1, 10));
    
        assertThrows(
            IndexOutOfBoundsException.class, () -> ByteStreams.readFully(newTestStream(10), b, 0, -1));
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/ByteStreamsTest.java

            NullPointerException.class, () -> ByteStreams.readFully(newTestStream(10), null, 0, 10));
    
        assertThrows(NullPointerException.class, () -> ByteStreams.readFully(null, b, 0, 10));
    
        assertThrows(
            IndexOutOfBoundsException.class, () -> ByteStreams.readFully(newTestStream(10), b, -1, 10));
    
        assertThrows(
            IndexOutOfBoundsException.class, () -> ByteStreams.readFully(newTestStream(10), b, 0, -1));
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (1)
  9. android/guava/src/com/google/common/io/ByteSource.java

    package com.google.common.io;
    
    import static com.google.common.base.Preconditions.checkArgument;
    import static com.google.common.base.Preconditions.checkNotNull;
    import static com.google.common.io.ByteStreams.createBuffer;
    import static com.google.common.io.ByteStreams.skipUpTo;
    
    import com.google.common.annotations.GwtIncompatible;
    import com.google.common.annotations.J2ktIncompatible;
    import com.google.common.base.Ascii;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 26.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/io/ByteSourceTest.java

        InputStream in = source.openBufferedStream();
        assertTrue(source.wasStreamOpened());
        assertFalse(source.wasStreamClosed());
    
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteStreams.copy(in, out);
        in.close();
        out.close();
    
        assertTrue(source.wasStreamClosed());
        assertArrayEquals(bytes, out.toByteArray());
      }
    
      public void testSize() throws IOException {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
Back to top