Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for adapter (0.29 sec)

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

        val sequenceOf = listOf(7L, 8L, 9L)
        val adapter = Adapters.INTEGER_AS_LONG.asSequenceOf()
        assertThat(adapter.fromDer(bytes)).isEqualTo(sequenceOf)
        assertThat(adapter.toDer(sequenceOf)).isEqualTo(bytes)
      }
    
      @Test fun `point with only x set`() {
        val bytes = "3003800109".decodeHex()
        val point = Point(9L, null)
        assertThat(Point.ADAPTER.fromDer(bytes)).isEqualTo(point)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  2. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerAdapter.kt

     */
    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.
       *
       * This must always return a value, though it doesn't necessarily need to consume data from
       * [reader]. For example, if the reader's peeked tag isn't readable by this adapter, it may return
       * a default value.
       *
    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)
  3. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Adapters.kt

            // will include a tag and length header as a prefix.
            val adapter = chooser(writer.typeHint) as DerAdapter<Any?>?
            when {
              adapter != null -> adapter.toDer(writer, value)
              else -> writer.writeOctetString(value as ByteString)
            }
          }
    
          override fun fromDer(reader: DerReader): Any? {
            val adapter = chooser(reader.typeHint) as DerAdapter<Any?>?
            return when {
    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-tls/src/main/kotlin/okhttp3/tls/internal/der/BasicDerAdapter.kt

     * hint for further adapters to process.
     *
     * Types like ANY and CHOICE that don't have a consistent tag cannot use this.
     */
    internal data class BasicDerAdapter<T>(
      private val name: String,
      /** The tag class this adapter expects, or -1 to match any tag class. */
      val tagClass: Int,
      /** The tag this adapter expects, or -1 to match any tag. */
      val tag: Long,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  5. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/HpackJsonUtil.kt

            },
          )
          .add(KotlinJsonAdapterFactory())
          .build()
      private val STORY_JSON_ADAPTER = MOSHI.adapter(Story::class.java)
    
      private val fileSystem = FileSystem.SYSTEM
    
      private fun readStory(source: BufferedSource): Story {
        return STORY_JSON_ADAPTER.fromJson(source)!!
      }
    
      private fun readStory(file: Path): Story {
        fileSystem.read(file) {
          return readStory(this)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/platform/android/AndroidSocketAdapterTest.kt

      fun testMatchesSupportedAndroidSocketFactory(adapter: SocketAdapter) {
        assumeTrue(adapter is StandardAndroidSocketAdapter)
    
        assertTrue(adapter.matchesSocketFactory(context.socketFactory))
        assertNotNull(adapter.trustManager(context.socketFactory))
      }
    
      @ParameterizedTest
      @MethodSource("data")
      fun testDoesntMatchSupportedCustomSocketFactory(adapter: SocketAdapter) {
        assumeFalse(adapter is StandardAndroidSocketAdapter)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  7. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/CertificateAdapters.kt

       * ```
       */
      private val attributeTypeAndValue: BasicDerAdapter<AttributeTypeAndValue> =
        Adapters.sequence(
          "AttributeTypeAndValue",
          Adapters.OBJECT_IDENTIFIER,
          Adapters.any(
            String::class to Adapters.UTF8_STRING,
            Nothing::class to Adapters.PRINTABLE_STRING,
            AnyValue::class to Adapters.ANY_VALUE,
          ),
          decompose = {
            listOf(
              it.type,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.6K bytes
    - Viewed (1)
  8. docs/changelogs/changelog_1x.md

     *  Fix a bug in `Content-Length` reporting for gzipped streams in the Apache
        HTTP client adapter. (thanks kwuollett)
     *  Work around the Alcatel `getByInetAddress` bug (thanks k.kocel)
     *  Be more aggressive about testing pooled sockets before reuse. (thanks
        warpspin)
     *  Include `Content-Type` and `Content-Encoding` in the Apache HTTP client
        adapter. (thanks kwuollett)
     *  Add a media type class to OkHttp.
     *  Change custom header prefix:
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 6.4K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/kt/ParseResponseWithMoshi.kt

    import okhttp3.OkHttpClient
    import okhttp3.Request
    
    class ParseResponseWithMoshi {
      private val client = OkHttpClient()
      private val moshi = Moshi.Builder().build()
      private val gistJsonAdapter = moshi.adapter(Gist::class.java)
    
      fun run() {
        val request =
          Request.Builder()
            .url("https://api.github.com/gists/c2a7c39532239ff261be")
            .build()
        client.newCall(request).execute().use { response ->
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (1)
  10. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        val request = Request.Builder().url("https://www.howsmyssl.com/a/check").build()
    
        val response = client.newCall(request).execute()
    
        val results =
          response.use {
            moshi.adapter(HowsMySslResults::class.java).fromJson(response.body.string())!!
          }
    
        Platform.get().log("results $results", Platform.WARN)
    
        assertTrue(results.session_ticket_supported)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 27K bytes
    - Viewed (1)
Back to top