Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 35 of 35 for byteCount (0.19 sec)

  1. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/internal/IsProbablyUtf8.kt

     * sample of code points to detect unicode control characters commonly used in binary file
     * signatures.
     */
    fun Buffer.isProbablyUtf8(): Boolean {
      try {
        val prefix = Buffer()
        val byteCount = size.coerceAtMost(64)
        copyTo(prefix, 0, byteCount)
        for (i in 0 until 16) {
          if (prefix.exhausted()) {
            break
          }
          val codePoint = prefix.readUtf8CodePoint()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 07 16:05:34 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ResponseCommonTest.kt

            var closed = false
    
            override fun close() {
              closed = true
            }
    
            override fun read(
              sink: Buffer,
              byteCount: Long,
            ): Long {
              check(!closed)
              return data.read(sink, byteCount)
            }
    
            override fun timeout(): Timeout {
              return Timeout.NONE
            }
          }
        return source.buffer().asResponseBody(null, -1)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/ResponseBodyTest.kt

        assertThat(body.bytes()).isEqualTo(text)
      }
    }
    
    abstract class ForwardingSource(
      val delegate: Source,
    ) : Source {
      override fun read(
        sink: Buffer,
        byteCount: Long,
      ): Long = delegate.read(sink, byteCount)
    
      override fun timeout() = delegate.timeout()
    
      override fun close() = delegate.close()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4K bytes
    - Viewed (0)
  4. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerWriter.kt

      /** Used for tags and subidentifiers. */
      private fun writeVariableLengthLong(v: Long) {
        val sink = sink()
        val bitCount = 64 - java.lang.Long.numberOfLeadingZeros(v)
        val byteCount = (bitCount + 6) / 7
        for (shift in (byteCount - 1) * 7 downTo 0 step 7) {
          val lastBit = if (shift == 0) 0 else 0b1000_0000
          sink.writeByte(((v shr shift) and 0b0111_1111).toInt() or lastBit)
        }
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  5. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

        headersBuilder.add(CHUNKED_BODY_HEADER)
    
        val bytesOut = Buffer()
        while (!body.exhausted()) {
          val chunkSize = minOf(body.size, maxChunkSize.toLong())
          bytesOut.writeHexadecimalUnsignedLong(chunkSize)
          bytesOut.writeUtf8("\r\n")
          bytesOut.write(body, chunkSize)
          bytesOut.writeUtf8("\r\n")
        }
        bytesOut.writeUtf8("0\r\n") // Last chunk. Trailers follow!
        this.body = bytesOut
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
Back to top