Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 106 for bytes (0.12 sec)

  1. okhttp/src/main/kotlin/okhttp3/Headers.kt

      /**
       * Returns the number of bytes required to encode these headers using HTTP/1.1. This is also the
       * approximate size of HTTP/2 headers before they are compressed with HPACK. This value is
       * intended to be used as a metric: smaller headers are more efficient to encode and transmit.
       */
      fun byteCount(): Long {
        // Each header name has 2 bytes of overhead for ': ' and every header value has 2 bytes of
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http1/Http1ExchangeCodec.kt

        return trailers ?: EMPTY_HEADERS
      }
    
      override fun flushRequest() {
        sink.flush()
      }
    
      override fun finishRequest() {
        sink.flush()
      }
    
      /** Returns bytes of a request header for sending on an HTTP transport. */
      fun writeRequest(
        headers: Headers,
        requestLine: String,
      ) {
        check(state == STATE_IDLE) { "state: $state" }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 16.2K bytes
    - Viewed (0)
  3. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Adapters.kt

            reader.read("ANY") { header ->
              val bytes = reader.readUnknown()
              return AnyValue(
                tagClass = header.tagClass,
                tag = header.tag,
                constructed = header.constructed,
                length = header.length,
                bytes = bytes,
              )
            }
          }
    
          override fun toDer(
            writer: DerWriter,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15K bytes
    - Viewed (0)
  4. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/DnsOverHttpsTest.kt

          assertThat(ioe.message).isEqualTo("google.com")
          val cause = ioe.cause!!
          assertThat(cause).isInstanceOf<IOException>()
          assertThat(cause).hasMessage("response size exceeds limit (65536 bytes): 65537 bytes")
        }
      }
    
      @Test
      fun failOnBadResponse() {
        server.enqueue(dnsResponse("00"))
        try {
          dns.lookup("google.com")
          fail<Any>()
        } catch (ioe: IOException) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 11K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/http2/HpackTest.kt

      }
    
      private fun assertBytes(vararg bytes: Int) {
        val expected = intArrayToByteArray(bytes)
        val actual = bytesOut.readByteString()
        assertThat(actual).isEqualTo(expected)
      }
    
      private fun intArrayToByteArray(bytes: IntArray): ByteString {
        val data = ByteArray(bytes.size)
        for (i in bytes.indices) {
          data[i] = bytes[i].toByte()
        }
        return ByteString.of(*data)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 38.2K bytes
    - Viewed (0)
  6. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerReader.kt

        // TODO(jwilson): detect overflow.
        var result = 0L
        while (true) {
          val byteN = source.readByte().toLong() and 0xff
          if ((byteN and 0b1000_0000L) == 0b1000_0000L) {
            result = (result + (byteN and 0b0111_1111)) shl 7
          } else {
            return result + byteN
          }
        }
      }
    
      /** Read a value as bytes without interpretation of its contents. */
      fun readUnknown(): ByteString {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  7. okhttp-testing-support/src/main/kotlin/okhttp3/UppercaseRequestInterceptor.kt

          @Throws(IOException::class)
          override fun write(
            source: Buffer,
            byteCount: Long,
          ) {
            val bytes = source.readByteString(byteCount)
            delegate.write(
              Buffer()
                .write(bytes.toAsciiUppercase()),
              byteCount,
            )
          }
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketProtocol.kt

      internal const val OPCODE_FLAG_CONTROL = 8
    
      /**
       * Byte 1 flag for whether the payload data is masked.
       *
       * If this flag is set, the next four
       * bytes represent the mask key. These bytes appear after any additional bytes specified by [B1_MASK_LENGTH].
       */
      internal const val B1_FLAG_MASK = 128
    
      /**
       * Byte 1 mask for the payload length.
       *
       * If this value is [PAYLOAD_SHORT], the next two
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/cache2/FileOperatorTest.kt

        assertFailsWith<IndexOutOfBoundsException> {
          operator.write(0, buffer, 4L)
        }
      }
    
      private fun randomByteString(byteCount: Int): ByteString {
        val bytes = ByteArray(byteCount)
        Random(0).nextBytes(bytes)
        return ByteString.of(*bytes)
      }
    
      private fun snapshot(): ByteString {
        randomAccessFile!!.getChannel().force(false)
        val source = file!!.source().buffer()
    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)
  10. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        } catch (expected: IOException) {
        }
        server.url("/b").toUrl().openConnection().getInputStream() // Should succeed.
      }
    
      /**
       * Throttle the request body by sleeping 500ms after every 3 bytes. With a 6-byte request, this
       * should yield one sleep for a total delay of 500ms.
       */
      @Test
      fun throttleRequest() {
        assumeNotWindows()
        server.enqueue(
          MockResponse()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 21.9K bytes
    - Viewed (0)
Back to top