Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 151 for Source (0.16 sec)

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

    import okio.ByteString
    import okio.ByteString.Companion.encodeUtf8
    import okio.Source
    import okio.Timeout
    
    /**
     * Replicates a single upstream source into multiple downstream sources. Each downstream source
     * returns the same bytes as the upstream source. Downstream sources may read data either as it
     * is returned by upstream, or after the upstream source has been exhausted.
     *
    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

      @Test
      fun sourceSeesBom() {
        val body = "efbbbf68656c6c6f".decodeHex().toResponseBody()
        val source = body.source()
        assertThat(source.readByte() and 0xff).isEqualTo(0xef)
        assertThat(source.readByte() and 0xff).isEqualTo(0xbb)
        assertThat(source.readByte() and 0xff).isEqualTo(0xbf)
        assertThat(source.readUtf8()).isEqualTo("hello")
      }
    
      @Test
      fun bytesEmpty() {
        val body = body("")
    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

    import okio.ForwardingSource
    import okio.IOException
    import okio.Source
    
    /** Fails decompression if the ratio is too high. */
    internal class DecompressionBombChecker(
      private val maxRatio: Long,
    ) {
      private var inputByteCount = 0L
      private var outputByteCount = 0L
    
      fun wrapInput(source: Source): Source {
        return object : ForwardingSource(source) {
          override fun read(
            sink: Buffer,
    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-sse/src/main/kotlin/okhttp3/sse/internal/ServerSentEventReader.kt

        while (true) {
          when (source.select(options)) {
            in 0..2 -> {
              completeEvent(id, type, data)
              return true
            }
    
            in 3..4 -> {
              source.readData(data)
            }
    
            in 5..7 -> {
              data.writeByte('\n'.code) // 'data' on a line of its own.
            }
    
            in 8..9 -> {
              id = source.readUtf8LineStrict().takeIf { it.isNotEmpty() }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  5. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSource.kt

      fun request(): Request
    
      /**
       * Immediately and violently release resources held by this event source. This does nothing if
       * the event source has already been closed or canceled.
       */
      fun cancel()
    
      fun interface Factory {
        /**
         * Creates a new event source and immediately returns it. Creating an event source initiates an
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnection.kt

          Http1ExchangeCodec(client, this, source, sink)
        }
      }
    
      @Throws(SocketException::class)
      internal fun newWebSocketStreams(exchange: Exchange): RealWebSocket.Streams {
        val socket = this.socket!!
        val source = this.source!!
        val sink = this.sink!!
    
        socket.soTimeout = 0
        noNewExchanges()
        return object : RealWebSocket.Streams(true, source, sink) {
          override fun close() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/http/RealResponseBody.kt

       */
      private val contentTypeString: String?,
      private val contentLength: Long,
      private val source: BufferedSource,
    ) : ResponseBody() {
      override fun contentLength(): Long = contentLength
    
      override fun contentType(): MediaType? = contentTypeString?.toMediaTypeOrNull()
    
      override fun source(): BufferedSource = source
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt

              sink.writeAll(response.body.source())
            }
          }
        }
    
      private suspend fun readImportResults(): ImportResults =
        withContext(Dispatchers.IO) {
          val sortedRules: SortedSet<ByteString> = TreeSet()
          val sortedExceptionRules: SortedSet<ByteString> = TreeSet()
          var totalRuleBytes = 0
          var totalExceptionRuleBytes = 0
    
          fileSystem.source(publicSuffixListDotDat).buffer().use { source ->
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

        }
    
        override fun data(
          inFinished: Boolean,
          streamId: Int,
          source: BufferedSource,
          length: Int,
        ) {
          check(type == -1)
          this.type = Http2.TYPE_DATA
          this.inFinished = inFinished
          this.streamId = streamId
          this.data = source.readByteString(length.toLong()).toByteArray()
        }
    
        override fun rstStream(
          streamId: Int,
    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)
  10. okhttp/src/main/kotlin/okhttp3/internal/http2/Huffman.kt

          addCode(i, CODES[i], CODE_BIT_COUNTS[i].toInt())
        }
      }
    
      @Throws(IOException::class)
      fun encode(
        source: ByteString,
        sink: BufferedSink,
      ) {
        var accumulator = 0L
        var accumulatorBitCount = 0
    
        for (i in 0 until source.size) {
          val symbol = source[i] and 0xff
          val code = CODES[symbol]
          val codeBitCount = CODE_BIT_COUNTS[symbol].toInt()
    
    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)
Back to top