Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for charStream (0.09 sec)

  1. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

        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 Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon May 13 13:42:37 UTC 2024
    - 13K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/ResponseBody.kt

     * re-read the bytes of the response. Use this one shot to read the entire response into memory with
     * [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?
    
      /**
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

            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()
        responseBody = "".toResponseBody("".toMediaType())
        responseBody = "".toResponseBody(null)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
  4. docs/recipes.md

    [Moshi](https://github.com/square/moshi) is a handy API for converting between JSON and Java objects. Here we're using it to decode a JSON response from a GitHub API.
    
    Note that `ResponseBody.charStream()` uses the `Content-Type` response header to select which charset to use when decoding the response body. It defaults to `UTF-8` if no charset is specified.
    
    === ":material-language-kotlin: Kotlin"
        ```kotlin
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Feb 18 08:52:22 UTC 2022
    - 40.2K bytes
    - Viewed (0)
  5. guava/src/com/google/common/io/CharStreams.java

    @J2ktIncompatible
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    public final class CharStreams {
    
      // 2K chars (4K bytes)
      private static final int DEFAULT_BUF_SIZE = 0x800;
    
      /** Creates a new {@code CharBuffer} for buffering reads or writes. */
      static CharBuffer createBuffer() {
        return CharBuffer.allocate(DEFAULT_BUF_SIZE);
      }
    
      private CharStreams() {}
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed May 17 14:35:11 UTC 2023
    - 10.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/io/CharStreamsTest.java

        Reader empty = new StringReader("");
        assertEquals(0, CharStreams.exhaust(empty));
        assertEquals(-1, empty.read());
      }
    
      public void testExhaust_readable() throws IOException {
        CharBuffer buf = CharBuffer.wrap(ASCII);
        assertEquals(ASCII.length(), CharStreams.exhaust(buf));
        assertEquals(0, buf.remaining());
        assertEquals(0, CharStreams.exhaust(buf));
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/io/CharStreamsTest.java

        Reader empty = new StringReader("");
        assertEquals(0, CharStreams.exhaust(empty));
        assertEquals(-1, empty.read());
      }
    
      public void testExhaust_readable() throws IOException {
        CharBuffer buf = CharBuffer.wrap(ASCII);
        assertEquals(ASCII.length(), CharStreams.exhaust(buf));
        assertEquals(0, buf.remaining());
        assertEquals(0, CharStreams.exhaust(buf));
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  8. guava/src/com/google/common/io/CharSource.java

      public long copyTo(Appendable appendable) throws IOException {
        checkNotNull(appendable);
    
        Closer closer = Closer.create();
        try {
          Reader reader = closer.register(openStream());
          return CharStreams.copy(reader, appendable);
        } catch (Throwable e) {
          throw closer.rethrow(e);
        } finally {
          closer.close();
        }
      }
    
      /**
       * Copies the contents of this source to the given sink.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  9. build-logic/documentation/src/main/groovy/gradlebuild/docs/ReleaseNotesTransformer.java

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package gradlebuild.docs;
    
    import com.google.common.io.CharStreams;
    import org.gradle.api.GradleException;
    import org.gradle.api.UncheckedIOException;
    import org.jsoup.Jsoup;
    import org.jsoup.nodes.Document;
    import org.jsoup.nodes.DocumentType;
    import org.jsoup.nodes.Element;
    Registered: Wed Nov 06 11:36:14 UTC 2024
    - Last Modified: Thu Oct 03 05:02:20 UTC 2024
    - 9.9K bytes
    - Viewed (0)
Back to top