Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 149 for source (0.15 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Stream.kt

        }
      }
    
      /**
       * Returns the trailers. It is only safe to call this once the source stream has been completely
       * exhausted.
       */
      @Throws(IOException::class)
      fun trailers(): Headers {
        this.withLock {
          if (source.finished && source.receiveBuffer.exhausted() && source.readBuffer.exhausted()) {
            return source.trailers ?: EMPTY_HEADERS
          }
          if (errorCode != null) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 23.2K bytes
    - Viewed (1)
  2. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerReader.kt

     */
    internal class DerReader(source: Source) {
      private val countingSource: CountingSource = CountingSource(source)
      private val source: BufferedSource = countingSource.buffer()
    
      /** Total bytes read thus far. */
      private val byteCount: Long
        get() = countingSource.bytesRead - source.buffer.size
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/Progress.java

          return responseBody.contentLength();
        }
    
        @Override public BufferedSource source() {
          if (bufferedSource == null) {
            bufferedSource = Okio.buffer(source(responseBody.source()));
          }
          return bufferedSource;
        }
    
        private Source source(Source source) {
          return new ForwardingSource(source) {
            long totalBytesRead = 0L;
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.9K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketReader.kt

        // Disable the timeout to read the first byte of a new frame.
        val b0: Int
        val timeoutBefore = source.timeout().timeoutNanos()
        source.timeout().clearTimeout()
        try {
          b0 = source.readByte() and 0xff
        } finally {
          source.timeout().timeout(timeoutBefore, TimeUnit.NANOSECONDS)
        }
    
        opcode = b0 and B0_MASK_OPCODE
        isFinalFrame = b0 and B0_FLAG_FIN != 0
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  5. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

            return
          } else if (protocol !== Protocol.HTTP_1_1) {
            throw AssertionError()
          }
    
          val source = socket.source().buffer()
          val sink = socket.sink().buffer()
    
          while (processOneRequest(socket, source, sink)) {
          }
    
          if (sequenceNumber == 0) {
            logger.warning(
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 37.4K bytes
    - Viewed (0)
  6. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsRecordCodec.kt

      @Throws(EOFException::class)
      private fun skipName(source: Buffer) {
        // 0 - 63 bytes
        var length = source.readByte().toInt()
    
        if (length < 0) {
          // compressed name pointer, first two bits are 1
          // drop second byte of compression offset
          source.skip(1)
        } else {
          while (length > 0) {
            // skip each part of the domain name
            source.skip(length.toLong())
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  7. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

              """
              |data: hey
              |
              |
              """.trimMargin(),
            ).setHeader("content-type", "text/event-stream")
            .build(),
        )
        val source = newEventSource()
        assertThat(source.request().url.encodedPath).isEqualTo("/")
        listener.assertOpen()
        listener.assertEvent(null, null, "hey")
        listener.assertClose()
      }
    
      @RetryingTest(5)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/-ResponseBodyCommon.kt

      }
    
      val bytes = source().use(consumer)
      val size = sizeMapper(bytes)
      if (contentLength != -1L && contentLength != size.toLong()) {
        throw IOException("Content-Length ($contentLength) and stream length ($size) disagree")
      }
      return bytes
    }
    
    internal fun ResponseBody.commonClose() = source().closeQuietly()
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/cache/DiskLruCache.kt

        /** Returns the unbuffered stream with the value for [index]. */
        fun getSource(index: Int): Source = sources[index]
    
        /** Returns the byte length of the value for [index]. */
        fun getLength(index: Int): Long = lengths[index]
    
        override fun close() {
          for (source in sources) {
            source.closeQuietly()
          }
        }
      }
    
      /** Edits the values for an entry. */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 34.7K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/-ResponseCommon.kt

    import okio.Buffer
    import okio.IOException
    import okio.Source
    import okio.Timeout
    import okio.buffer
    
    internal class UnreadableResponseBody(
      private val mediaType: MediaType?,
      private val contentLength: Long,
    ) : ResponseBody(), Source {
      override fun contentType() = mediaType
    
      override fun contentLength() = contentLength
    
      override fun source() = buffer()
    
      override fun read(
        sink: Buffer,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 5.2K bytes
    - Viewed (0)
Back to top