Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 90 for source (0.2 sec)

  1. okhttp-brotli/src/main/kotlin/okhttp3/brotli/internal/DecompressionBombChecker.kt

    import okio.ForwardingSource
    import okio.IOException
    import okio.Source
    
    /** Fails decompression if the ratio is too high. */
    internal class DecompressionBombChecker(
      private val maxRatio: Long,
    ) {
      private var inputByteCount = 0L
      private var outputByteCount = 0L
    
      fun wrapInput(source: Source): Source {
        return object : ForwardingSource(source) {
          override fun read(
            sink: Buffer,
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 29 22:50:20 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  2. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/ServerSentEventReader.kt

        while (true) {
          when (source.select(options)) {
            in 0..2 -> {
              completeEvent(id, type, data)
              return true
            }
    
            in 3..4 -> {
              source.readData(data)
            }
    
            in 5..7 -> {
              data.writeByte('\n'.code) // 'data' on a line of its own.
            }
    
            in 8..9 -> {
              id = source.readUtf8LineStrict().takeIf { it.isNotEmpty() }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  3. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSource.kt

      fun request(): Request
    
      /**
       * Immediately and violently release resources held by this event source. This does nothing if
       * the event source has already been closed or canceled.
       */
      fun cancel()
    
      fun interface Factory {
        /**
         * Creates a new event source and immediately returns it. Creating an event source initiates an
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt

              sink.writeAll(response.body.source())
            }
          }
        }
    
      private suspend fun readImportResults(): ImportResults =
        withContext(Dispatchers.IO) {
          val sortedRules: SortedSet<ByteString> = TreeSet()
          val sortedExceptionRules: SortedSet<ByteString> = TreeSet()
          var totalRuleBytes = 0
          var totalExceptionRuleBytes = 0
    
          fileSystem.source(publicSuffixListDotDat).buffer().use { source ->
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 6K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http/RealResponseBody.kt

       */
      private val contentTypeString: String?,
      private val contentLength: Long,
      private val source: BufferedSource,
    ) : ResponseBody() {
      override fun contentLength(): Long = contentLength
    
      override fun contentType(): MediaType? = contentTypeString?.toMediaTypeOrNull()
    
      override fun source(): BufferedSource = source
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

        }
    
        override fun data(
          inFinished: Boolean,
          streamId: Int,
          source: BufferedSource,
          length: Int,
        ) {
          check(type == -1)
          this.type = Http2.TYPE_DATA
          this.inFinished = inFinished
          this.streamId = streamId
          this.data = source.readByteString(length.toLong()).toByteArray()
        }
    
        override fun rstStream(
          streamId: Int,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/http2/Huffman.kt

          addCode(i, CODES[i], CODE_BIT_COUNTS[i].toInt())
        }
      }
    
      @Throws(IOException::class)
      fun encode(
        source: ByteString,
        sink: BufferedSink,
      ) {
        var accumulator = 0L
        var accumulatorBitCount = 0
    
        for (i in 0 until source.size) {
          val symbol = source[i] and 0xff
          val code = CODES[symbol]
          val codeBitCount = CODE_BIT_COUNTS[symbol].toInt()
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/internal/http/ExternalHttp2Example.kt

    /*
     * Copyright (C) 2009 The Android Open Source Project
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *      http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  9. samples/slack/src/main/java/okhttp3/slack/SlackApi.java

        Call call = httpClient.newCall(request);
        try (Response response = call.execute()) {
          JsonAdapter<OAuthSession> jsonAdapter = moshi.adapter(OAuthSession.class);
          return jsonAdapter.fromJson(response.body().source());
        }
      }
    
      /** See https://api.slack.com/methods/rtm.start. */
      public RtmStartResponse rtmStart(String accessToken) throws IOException {
        HttpUrl url = baseUrl.newBuilder("rtm.start")
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 19:30:55 GMT 2018
    - 4.4K bytes
    - Viewed (1)
  10. okhttp-sse/src/test/java/okhttp3/sse/internal/ServerSentEventIteratorTest.kt

      @Test
      fun nakedRetryIgnored() {
        consumeEvents(
          """
          |retry
          |
          """.trimMargin(),
        )
        assertThat(callbacks).isEmpty()
      }
    
      private fun consumeEvents(source: String) {
        val callback: ServerSentEventReader.Callback =
          object : ServerSentEventReader.Callback {
            override fun onEvent(
              id: String?,
              type: String?,
              data: String,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.4K bytes
    - Viewed (0)
Back to top