Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 99 for buffer (0.14 sec)

  1. okhttp/src/test/java/okhttp3/internal/cache2/FileOperatorTest.kt

        val buffer = Buffer()
        operator.read(6, buffer, 21)
        operator.read(36, buffer, 1)
        operator.read(5, buffer, 5)
        operator.read(28, buffer, 8)
        operator.read(17, buffer, 10)
        operator.read(36, buffer, 2)
        operator.read(2, buffer, 4)
        operator.write(0, buffer, buffer.size)
        operator.read(0, buffer, 12)
        operator.read(47, buffer, 3)
        operator.read(45, buffer, 2)
        operator.read(47, buffer, 3)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/cache2/RelayTest.kt

      private fun sourceReader(source: Source?): Callable<ByteString> {
        return Callable {
          val buffer = Buffer()
          while (source!!.read(buffer, 16384) != -1L) {
          }
          source.close()
          buffer.readByteString()
        }
      }
    
      private fun assertFile(
        prefix: ByteString,
        upstreamSize: Long,
        metadataSize: Int,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/ws/MessageDeflater.kt

      private val deflaterSink = DeflaterSink(deflatedBytes, deflater)
    
      /** Deflates [buffer] in place as described in RFC 7692 section 7.2.1. */
      @Throws(IOException::class)
      fun deflate(buffer: Buffer) {
        require(deflatedBytes.size == 0L)
    
        if (noContextTakeover) {
          deflater.reset()
        }
    
        deflaterSink.write(buffer, buffer.size)
        deflaterSink.flush()
    
        if (deflatedBytes.endsWith(EMPTY_DEFLATE_BLOCK)) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/idn/StringprepTablesReaderTest.kt

      }
    
      @Test fun readCodePointSet() {
        val buffer = Buffer()
        buffer.writeUtf8(
          """
          |  0221
          |  0234-024F
          |  0000-001F; [CONTROL CHARACTERS]
          |  007F; DELETE
          |
          """.trimMargin(),
        )
    
        val rangeList = buffer.readCodePointSet()
        assertEquals(
          listOf(
            0x0221..0x0221,
            0x0234..0x024f,
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/FormBodyTest.kt

        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
      }
    
      @Test
      fun buildEmptyForm() {
        val body = FormBody.Builder().build()
        val expected = ""
        assertThat(body.contentLength()).isEqualTo(expected.length.toLong())
        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/FormBody.kt

      ): Long {
        var byteCount = 0L
        val buffer: Buffer = if (countBytes) Buffer() else sink!!.buffer
    
        for (i in 0 until encodedNames.size) {
          if (i > 0) buffer.writeByte('&'.code)
          buffer.writeUtf8(encodedNames[i])
          buffer.writeByte('='.code)
          buffer.writeUtf8(encodedValues[i])
        }
    
        if (countBytes) {
          byteCount = buffer.size
          buffer.clear()
        }
    
        return byteCount
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/ws/MessageInflater.kt

      private val inflaterSource = InflaterSource(deflatedBytes, inflater)
    
      /** Inflates [buffer] in place as described in RFC 7692 section 7.2.2. */
      @Throws(IOException::class)
      fun inflate(buffer: Buffer) {
        require(deflatedBytes.size == 0L)
    
        if (noContextTakeover) {
          inflater.reset()
        }
    
        deflatedBytes.writeAll(buffer)
        deflatedBytes.writeInt(OCTETS_TO_ADD_BEFORE_INFLATION)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  8. okhttp-logging-interceptor/src/test/java/okhttp3/logging/IsProbablyUtf8Test.kt

    import okhttp3.logging.internal.isProbablyUtf8
    import okio.Buffer
    import org.junit.jupiter.api.Test
    
    class IsProbablyUtf8Test {
      @Test fun isProbablyUtf8() {
        assertThat(Buffer().isProbablyUtf8()).isTrue()
        assertThat(Buffer().writeUtf8("abc").isProbablyUtf8()).isTrue()
        assertThat(Buffer().writeUtf8("new\r\nlines").isProbablyUtf8()).isTrue()
        assertThat(Buffer().writeUtf8("white\t space").isProbablyUtf8()).isTrue()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/UppercaseResponseInterceptor.kt

            val read = delegate.read(buffer, byteCount)
            if (read != -1L) {
              sink.write(buffer.readByteString().toAsciiUppercase())
            }
            return read
          }
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/SocksProxy.kt

          val name = "SocksProxy $fromAddress to $toAddress"
          threadName(name) {
            val buffer = Buffer()
            try {
              sink.use {
                source.use {
                  while (true) {
                    val byteCount = source.read(buffer, 8192L)
                    if (byteCount == -1L) break
                    sink.write(buffer, byteCount)
                    sink.emit()
                  }
                }
              }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 7.7K bytes
    - Viewed (0)
Back to top