Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for inet4AddressToAscii (0.09 sec)

  1. okhttp/src/test/java/okhttp3/internal/HostnamesTest.kt

      }
    
      @Test
      fun inet4AddressToAscii() {
        assertThat(
          inet4AddressToAscii(
            byteArrayOf(0, 0, 0, 0),
          ),
        ).isEqualTo("0.0.0.0")
    
        assertThat(
          inet4AddressToAscii(
            byteArrayOf(1, 2, 3, 4),
          ),
        ).isEqualTo("1.2.3.4")
    
        assertThat(
          inet4AddressToAscii(
            byteArrayOf(127, 0, 0, 1),
          ),
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 30 06:23:33 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

      if (address[10] != 255.toByte()) return false
      if (address[11] != 255.toByte()) return false
    
      return true
    }
    
    /** Encodes an IPv4 address in canonical form according to RFC 4001. */
    internal fun inet4AddressToAscii(address: ByteArray): String {
      require(address.size == 4)
      return Buffer()
        .writeDecimalLong((address[0] and 0xff).toLong())
        .writeByte('.'.code)
        .writeDecimalLong((address[1] and 0xff).toLong())
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 11.2K bytes
    - Viewed (0)
Back to top