Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 94 for ByteString (0.24 sec)

  1. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsRecordCodec.kt

          writeShort(1) // CLASS_IN
        }.readByteString()
    
      @Throws(Exception::class)
      fun decodeAnswers(
        hostname: String,
        byteString: ByteString,
      ): List<InetAddress> {
        val result = mutableListOf<InetAddress>()
    
        val buf = Buffer()
        buf.write(byteString)
        buf.readShort() // query id
    
        val flags = buf.readShort().toInt() and 0xffff
        require(flags shr 15 != 0) { "not a response" }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. okhttp-brotli/src/test/java/okhttp3/brotli/BrotliBombTest.kt

    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.ResponseBody.Companion.toResponseBody
    import okhttp3.brotli.internal.uncompress
    import okio.Buffer
    import okio.BufferedSource
    import okio.ByteString
    import okio.ByteString.Companion.decodeHex
    import okio.IOException
    import okio.buffer
    import okio.gzip
    import org.junit.jupiter.api.Test
    
    class BrotliBombTest {
      /** https://github.com/square/okhttp/issues/7738 */
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 29 22:50:20 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  3. okhttp-tls/src/main/kotlin/okhttp3/tls/HeldCertificate.kt

    import okhttp3.tls.internal.der.ObjectIdentifiers.SUBJECT_ALTERNATIVE_NAME
    import okhttp3.tls.internal.der.TbsCertificate
    import okhttp3.tls.internal.der.Validity
    import okio.ByteString
    import okio.ByteString.Companion.decodeBase64
    import okio.ByteString.Companion.toByteString
    
    /**
     * A certificate and its private key. These are some properties of certificates that are used with
     * TLS:
     *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 21.6K bytes
    - Viewed (1)
  4. okhttp/src/test/java/okhttp3/ResponseBodyTest.kt

    import kotlin.test.Test
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.ResponseBody.Companion.toResponseBody
    import okio.Buffer
    import okio.BufferedSource
    import okio.ByteString.Companion.decodeHex
    import okio.ByteString.Companion.encodeUtf8
    import okio.IOException
    import okio.Source
    import okio.buffer
    
    class ResponseBodyTest {
      @Test
      fun sourceEmpty() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

          )
        }
      }
    
      @Test
      fun byteStringEmpty() {
        val body = body("")
        assertThat(body.byteString()).isEqualTo(ByteString.EMPTY)
      }
    
      @Test
      fun byteStringSeesBom() {
        val body = body("efbbbf68656c6c6f")
        val actual = body.byteString()
        val expected: ByteString = "efbbbf68656c6c6f".decodeHex()
        assertThat(actual).isEqualTo(expected)
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  6. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerWriter.kt

        }
      }
    
      fun writeBitString(bitString: BitString) {
        val sink = sink()
        sink.writeByte(bitString.unusedBitsCount)
        sink.write(bitString.byteString)
      }
    
      fun writeOctetString(byteString: ByteString) {
        sink().write(byteString)
      }
    
      fun writeUtf8(value: String) {
        sink().writeUtf8(value)
      }
    
      fun writeObjectIdentifier(s: String) {
        val utf8 = Buffer().writeUtf8(s)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http2/BaseTestHandler.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.internal.http2
    
    import assertk.fail
    import okio.BufferedSource
    import okio.ByteString
    
    internal open class BaseTestHandler : Http2Reader.Handler {
      override fun data(
        inFinished: Boolean,
        streamId: Int,
        source: BufferedSource,
        length: Int,
      ) {
        fail("")
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2K bytes
    - Viewed (0)
  8. okhttp-idna-mapping-table/src/main/kotlin/okhttp3/internal/idn/MappedRange.kt

        override val rangeStart: Int,
        private val mappedTo: ByteString,
      ) : MappedRange {
        val b1: Int
          get() {
            val b3bit8 = mappedTo[0] and 0x80 != 0
            return if (b3bit8) 123 else 122
          }
    
        val b2: Int
          get() = mappedTo[0] and 0x7f
      }
    
      data class Inline2(
        override val rangeStart: Int,
        private val mappedTo: ByteString,
      ) : MappedRange {
        val b1: Int
          get() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  9. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerAdapter.kt

       *
       * If there's nothing to read and no default value, this will throw an exception.
       */
      fun fromDer(reader: DerReader): T
    
      fun fromDer(byteString: ByteString): T {
        val buffer = Buffer().write(byteString)
        val reader = DerReader(buffer)
        return fromDer(reader)
      }
    
      /**
       * Writes [value] to this adapter, unless it is the default value and can be safely omitted.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/ws/WebSocketReaderTest.kt

    import java.util.Random
    import kotlin.test.assertFailsWith
    import okhttp3.internal.format
    import okio.Buffer
    import okio.ByteString
    import okio.ByteString.Companion.EMPTY
    import okio.ByteString.Companion.decodeHex
    import okio.ByteString.Companion.encodeUtf8
    import okio.ByteString.Companion.toByteString
    import org.junit.jupiter.api.AfterEach
    import org.junit.jupiter.api.Test
    
    class WebSocketReaderTest {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 14.4K bytes
    - Viewed (0)
Back to top