Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 106 for bytes (0.2 sec)

  1. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

      }
    
      @Test fun `five byte integer`() {
        val bytes = "02058000000001".decodeHex()
        assertThat(Adapters.INTEGER_AS_LONG.fromDer(bytes)).isEqualTo(-549755813887L)
        assertThat(Adapters.INTEGER_AS_LONG.toDer(-549755813887L)).isEqualTo(bytes)
      }
    
      @Test fun `eight zeros`() {
        val bytes = "020200ff".decodeHex()
        assertThat(Adapters.INTEGER_AS_LONG.fromDer(bytes)).isEqualTo(255)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/cache2/Relay.kt

       *
       *  * 16 bytes: either `OkHttp cache v1\n` if the persisted file is complete. This is another
       *    sequence of bytes if the file is incomplete and should not be used.
       *  * 8 bytes: *n*: upstream data size
       *  * 8 bytes: *m*: metadata size
       *  * *n* bytes: upstream data
       *  * *m* bytes: metadata
       *
    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)
  3. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

        val body = body("")
        assertThat(body.bytes().size).isEqualTo(0)
      }
    
      @Test
      fun bytesSeesBom() {
        val body = body("efbbbf68656c6c6f")
        val bytes = body.bytes()
        assertThat(bytes[0] and 0xff).isEqualTo(0xef)
        assertThat(bytes[1] and 0xff).isEqualTo(0xbb)
        assertThat(bytes[2] and 0xff).isEqualTo(0xbf)
        assertThat(String(bytes, 3, 5, StandardCharsets.UTF_8)).isEqualTo("hello")
      }
    
    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)
  4. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/AnyValue.kt

      var length: Long = -1L,
      val bytes: ByteString,
    ) {
      // Avoid Long.hashCode(long) which isn't available on Android 5.
      override fun hashCode(): Int {
        var result = 0
        result = 31 * result + tagClass
        result = 31 * result + tag.toInt()
        result = 31 * result + (if (constructed) 0 else 1)
        result = 31 * result + length.toInt()
        result = 31 * result + bytes.hashCode()
        return result
      }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http2/Huffman.kt

          sink.writeByte(accumulator.toInt())
        }
      }
    
      fun encodedLength(bytes: ByteString): Int {
        var bitCount = 0L
    
        for (i in 0 until bytes.size) {
          val byteIn = bytes[i] and 0xff
          bitCount += CODE_BIT_COUNTS[byteIn].toLong()
        }
    
        return ((bitCount + 7) shr 3).toInt() // Round up to an even byte.
      }
    
      fun decode(
        source: BufferedSource,
        byteCount: Long,
    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)
  6. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

        // We've successfully read a group. Assign its value to our byte array.
        address[b++] = (value.ushr(8) and 0xff).toByte()
        address[b++] = (value and 0xff).toByte()
      }
    
      // All done. If compression happened, we need to move bytes to the right place in the
      // address. Here's a sample:
      //
      //      input: "1111:2222:3333::7777:8888"
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  7. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/ServerSentEventReader.kt

        @Throws(IOException::class)
        private fun BufferedSource.readData(data: Buffer) {
          data.writeByte('\n'.code)
          readFully(data, indexOfElement(CRLF))
          select(options) // Skip the newline bytes.
        }
    
        @Throws(IOException::class)
        private fun BufferedSource.readRetryMs(): Long {
          val retryString = readUtf8LineStrict()
          return retryString.toLongOrDefault(-1L)
        }
      }
    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)
  8. docs/changelogs/changelog_4x.md

        If you want this update with the old behavior use [this interceptor][legacy_interceptor].
    
     *  Fix: Don't crash decompressing web sockets messages. We had a bug where we assumed deflated
        bytes in would always yield deflated bytes out and this isn't always the case!
    
     *  Fix: Reliably update and invalidate the disk cache on windows. As originally designed our
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  9. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerAdapter.kt

     * limitations under the License.
     */
    package okhttp3.tls.internal.der
    
    import okio.Buffer
    import okio.ByteString
    
    /**
     * Encode and decode a model object like a [Long] or [Certificate] as DER bytes.
     */
    internal interface DerAdapter<T> {
      /** Returns true if this adapter can read [header] in a choice. */
      fun matches(header: DerHeader): Boolean
    
      /**
       * Returns a value from this adapter.
       *
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

            )
            .hostnameVerifier(RecordingHostnameVerifier())
            .build()
        server.useHttps(handshakeCertificates.sslSocketFactory())
      }
    
      /** A request body that slowly trickles bytes, expecting to not complete. */
      private object SlowRequestBody : RequestBody() {
        override fun contentType(): MediaType? = null
    
        override fun writeTo(sink: BufferedSink) {
          for (i in 0 until 50) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top