Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 126 for read (0.15 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache2/Relay.kt

            sourcePos += bytesToRead
            return bytesToRead
          }
    
          // Read from upstream. This always reads a full buffer: that might be more than what the
          // current call to Source.read() has requested.
          try {
            val upstreamBytesRead = upstream!!.read(upstreamBuffer, bufferMaxSize)
    
            // If we've exhausted upstream, we're done.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

        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)
        assertThat(bytes.read()).isEqualTo(0xbf)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  3. okhttp-brotli/src/main/kotlin/okhttp3/brotli/internal/DecompressionBombChecker.kt

      private var outputByteCount = 0L
    
      fun wrapInput(source: Source): Source {
        return object : ForwardingSource(source) {
          override fun read(
            sink: Buffer,
            byteCount: Long,
          ): Long {
            val result = super.read(sink, byteCount)
            if (result == -1L) return result
            inputByteCount += result
            return result
          }
        }
      }
    
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 29 22:50:20 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  4. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

        val derReader = DerReader(buffer)
    
        derReader.read("test") { header ->
          assertThat(header.tag).isEqualTo(16L)
    
          derReader.read("test") { header2 ->
            assertThat(header2.tag).isEqualTo(21L)
            assertThat(derReader.readOctetString()).isEqualTo("Smith".encodeUtf8())
          }
    
          derReader.read("test") { header3 ->
            assertThat(header3.tag).isEqualTo(1L)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  5. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerAdapter.kt

       * a default value.
       *
       * If this does read a value, it starts with the tag and length, and reads an entire value,
       * including any potential composed values.
       *
       * If there's nothing to read and no default value, this will throw an exception.
       */
      fun fromDer(reader: DerReader): T
    
      fun fromDer(byteString: ByteString): T {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

      var b = addressOffset
    
      var i = pos
      while (i < limit) {
        if (b == address.size) return false // Too many groups.
    
        // Read a delimiter.
        if (b != addressOffset) {
          if (input[i] != '.') return false // Wrong delimiter.
          i++
        }
    
        // Read 1 or more decimal digits for a value in 0..255.
        var value = 0
        val groupOffset = i
        while (i < limit) {
          val c = input[i]
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

        require(length < bytesOut.size - lastFrame.start)
    
        // Move everything from bytesOut into a new buffer.
        val fullBuffer = Buffer()
        bytesOut.read(fullBuffer, bytesOut.size)
    
        // Copy back all but what we're truncating.
        fullBuffer.read(bytesOut, lastFrame.start + length)
        outFrames.add(OutFrame(lastFrame.sequence, lastFrame.start, true))
        return writer
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        val inputStream = response.body.byteStream()
        assertThat(inputStream.read().toChar()).isEqualTo('A')
        call.cancel()
        assertFailsWith<IOException> {
          // Reading 'B' may succeed if it's buffered.
          inputStream.read()
    
          // But 'C' shouldn't be buffered (the response is throttled) and this should fail.
          inputStream.read()
        }
        inputStream.close()
      }
    
      @Test
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http2/Huffman.kt

        val terminalBitCount: Int
    
        /** Construct an internal node. */
        constructor() {
          this.children = arrayOfNulls(256)
          this.symbol = 0 // Not read.
          this.terminalBitCount = 0 // Not read.
        }
    
        /** Construct a terminal node. */
        constructor(symbol: Int, bits: Int) {
          this.children = null
          this.symbol = symbol
          val b = bits and 0x07
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/Callback.kt

       */
      fun onFailure(
        call: Call,
        e: IOException,
      )
    
      /**
       * Called when the HTTP response was successfully returned by the remote server. The callback may
       * proceed to read the response body with [Response.body]. The response is still live until its
       * response body is [closed][ResponseBody]. The recipient of the callback may consume the response
       * body on another thread.
       *
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (0)
Back to top