Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 149 for source (0.14 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache/FaultHidingSink.kt

      val onException: (IOException) -> Unit,
    ) : ForwardingSink(delegate) {
      private var hasErrors = false
    
      override fun write(
        source: Buffer,
        byteCount: Long,
      ) {
        if (hasErrors) {
          source.skip(byteCount)
          return
        }
        try {
          super.write(source, byteCount)
        } catch (e: IOException) {
          hasErrors = true
          onException(e)
        }
      }
    
      override fun flush() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http1/HeadersReader.kt

    /**
     * Parse all headers delimited by "\r\n" until an empty line. This throws if headers exceed 256 KiB.
     */
    class HeadersReader(val source: BufferedSource) {
      private var headerLimit = HEADER_LIMIT.toLong()
    
      /** Read a single line counted against the header size limit. */
      fun readLine(): String {
        val line = source.readUtf8LineStrict(headerLimit)
        headerLimit -= line.length.toLong()
        return line
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/WebPlatformUrlTest.kt

          val resourceAsStream =
            WebPlatformUrlTest::class.java.getResourceAsStream(
              "/web-platform-test-urltestdata.txt",
            )
          val source = resourceAsStream.source().buffer()
          return WebPlatformUrlTestData.load(source)
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/MultipartReader.kt

        private var closed = false
        private var noMoreParts = false
    
        /** This is only part that's allowed to read from the underlying source. */
        private var currentPart: PartSource? = null
    
        @Throws(IOException::class)
        constructor(response: ResponseBody) : this(
          source = response.source(),
          boundary =
            response.contentType()?.parameter("boundary")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Reader.kt

        // +---------------------------------------------------------------+
        val length = source.readMedium()
        if (length > INITIAL_MAX_FRAME_SIZE) {
          throw IOException("FRAME_SIZE_ERROR: $length")
        }
        val type = source.readByte() and 0xff
        val flags = source.readByte() and 0xff
        val streamId = source.readInt() and 0x7fffffff // Ignore reserved bit.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 19.9K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/ResponseBody.kt

       */
      @Throws(IOException::class)
      fun string(): String =
        source().use { source ->
          source.readString(charset = source.readBomAsCharset(charset()))
        }
    
      private fun charset() = contentType().charsetOrUtf8()
    
      override fun close() = commonClose()
    
      internal class BomAwareReader(
        private val source: BufferedSource,
        private val charset: Charset,
      ) : Reader() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  7. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/HpackJsonUtil.kt

          .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)
  8. okhttp/src/test/java/okhttp3/internal/io/FaultyFileSystem.kt

        } else {
          renameFaults.remove(file)
        }
      }
    
      @Throws(IOException::class)
      override fun atomicMove(
        source: Path,
        target: Path,
      ) {
        if (renameFaults.contains(source) || renameFaults.contains(target)) throw IOException("boom!")
        super.atomicMove(source, target)
      }
    
      @Throws(IOException::class)
      override fun delete(
        path: Path,
        mustExist: Boolean,
      ) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

            }
          }
        }
    
        return response
      }
    
      /**
       * Returns a new source that writes bytes to [cacheRequest] as they are read by the source
       * consumer. This is careful to discard bytes left over when the stream is closed; otherwise we
       * may never exhaust the source stream and therefore not complete the cached response.
       */
      @Throws(IOException::class)
      private fun cacheWritingResponse(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

     * unhealthy.
     *
     * @param source the source used to read bytes from the socket.
     */
    internal fun Socket.isHealthy(source: BufferedSource): Boolean {
      return try {
        val readTimeout = soTimeout
        try {
          soTimeout = 1
          !source.exhausted()
        } finally {
          soTimeout = readTimeout
        }
      } catch (_: SocketTimeoutException) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
Back to top