Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 41 for ByteArray (0.16 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

     */
    internal fun canonicalizeInetAddress(address: ByteArray): ByteArray {
      return when {
        isMappedIpv4Address(address) -> address.sliceArray(12 until 16)
        else -> address
      }
    }
    
    /** Returns true for IPv6 addresses like `0000:0000:0000:0000:0000:ffff:XXXX:XXXX`. */
    private fun isMappedIpv4Address(address: ByteArray): Boolean {
      if (address.size != 16) return false
    
      for (i in 0 until 10) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

      // PublicSuffixListGenerator class for how these lists are generated.
      // Guarded by this.
      private lateinit var publicSuffixListBytes: ByteArray
      private lateinit var publicSuffixExceptionListBytes: ByteArray
    
      /**
       * Returns the effective top-level domain plus one (eTLD+1) by referencing the public suffix list.
       * Returns null if the domain is a public suffix or a private address.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/hash/LittleEndianByteArray.java

     */
    @ElementTypesAreNonnullByDefault
    final class LittleEndianByteArray {
    
      /** The instance that actually does the work; delegates to Unsafe or a pure-Java fallback. */
      private static final LittleEndianBytes byteArray;
    
      /**
       * Load 8 bytes into long in a little endian manner, from the substring between position and
       * position + 8. The array must have at least 8 bytes from offset (inclusive).
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 9.7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/http2/Http2Test.kt

        }
      }
    
      @Test fun readPaddedDataFrame() {
        val dataLength = 1123
        val expectedData = ByteArray(dataLength)
        Arrays.fill(expectedData, 2.toByte())
        val paddingLength = 254
        val padding = ByteArray(paddingLength)
        Arrays.fill(padding, 0.toByte())
        writeMedium(frame, dataLength + paddingLength + 1)
        frame.writeByte(Http2.TYPE_DATA)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt

            .body(
              Buffer()
                .write(ByteArray(responseBodySize)),
            )
            .throttleBody(64 * 1024, 125, MILLISECONDS) // 500 Kbps
            .build(),
        )
        val call = client.newCall(Request(server.url("/")))
        val response = call.execute()
        cancelLater(call, 500)
        val responseBody = response.body.byteStream()
        val buffer = ByteArray(1024)
        assertFailsWith<IOException> {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/HostnamesTest.kt

      }
    
      @Test
      fun canonicalizeInetAddressIPv6RepresentationOfCompatibleIPV4() {
        val addressAIpv6 = decodeIpv6("::192.168.0.1")!!
        assertThat(canonicalizeInetAddress(addressAIpv6)).isEqualTo(
          ByteArray(12) +
            byteArrayOf(
              192.toByte(),
              168.toByte(),
              0,
              1,
            ),
        )
      }
    
      @Test
      fun canonicalizeInetAddressIPv6RepresentationOfMappedIPV4() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 30 06:23:33 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

        }
      }
    
      @Test
      fun interruptReadingResponseBody() {
        val responseBodySize = 8 * 1024 * 1024 // 8 MiB.
        server.enqueue(
          MockResponse()
            .setBody(Buffer().write(ByteArray(responseBodySize)))
            .throttleBody((64 * 1024).toLong(), 125, TimeUnit.MILLISECONDS),
        ) // 500 Kbps
        server.start()
        val call =
          client.newCall(
            Request.Builder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketWriter.kt

      private var writerClosed = false
    
      /** Lazily initialized on first use. */
      private var messageDeflater: MessageDeflater? = null
    
      // Masks are only a concern for client writers.
      private val maskKey: ByteArray? = if (isClient) ByteArray(4) else null
      private val maskCursor: Buffer.UnsafeCursor? = if (isClient) Buffer.UnsafeCursor() else null
    
      /** Send a ping with the supplied [payload]. */
      @Throws(IOException::class)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/platform/android/AndroidSocketAdapter.kt

      private val getAlpnSelectedProtocol = sslSocketClass.getMethod("getAlpnSelectedProtocol")
      private val setAlpnProtocols =
        sslSocketClass.getMethod("setAlpnProtocols", ByteArray::class.java)
    
      override fun isSupported(): Boolean = AndroidPlatform.isSupported
    
      override fun matchesSocket(sslSocket: SSLSocket): Boolean = sslSocketClass.isInstance(sslSocket)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/math/Stats.java

       * versions.
       */
      public static Stats fromByteArray(byte[] byteArray) {
        checkNotNull(byteArray);
        checkArgument(
            byteArray.length == BYTES,
            "Expected Stats.BYTES = %s remaining , got %s",
            BYTES,
            byteArray.length);
        return readFrom(ByteBuffer.wrap(byteArray).order(ByteOrder.LITTLE_ENDIAN));
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 22K bytes
    - Viewed (0)
Back to top