Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for readLong (0.18 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache2/Relay.kt

          val prefix = header.readByteString(PREFIX_CLEAN.size.toLong())
          if (prefix != PREFIX_CLEAN) throw IOException("unreadable cache file")
          val upstreamSize = header.readLong()
          val metadataSize = header.readLong()
    
          // Read the metadata.
          val metadataBuffer = Buffer()
          fileOperator.read(FILE_HEADER_SIZE + upstreamSize, metadataBuffer, metadataSize)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/cache2/RelayTest.kt

        metadata: ByteString?,
      ) {
        val source = file.source().buffer()
        assertThat(source.readByteString(prefix.size.toLong())).isEqualTo(prefix)
        assertThat(source.readLong()).isEqualTo(upstreamSize)
        assertThat(source.readLong()).isEqualTo(metadataSize.toLong())
        if (upstream != null) {
          assertThat(source.readUtf8(upstreamSize)).isEqualTo(upstream)
        }
        if (metadata != null) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  3. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Adapters.kt

          name = "INTEGER",
          tagClass = DerHeader.TAG_CLASS_UNIVERSAL,
          tag = 2L,
          codec =
            object : BasicDerAdapter.Codec<Long> {
              override fun decode(reader: DerReader): Long = reader.readLong()
    
              override fun encode(
                writer: DerWriter,
                value: Long,
              ) = writer.writeLong(value)
            },
        )
    
      val INTEGER_AS_BIG_INTEGER =
        BasicDerAdapter(
    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/src/main/kotlin/okhttp3/internal/ws/WebSocketReader.kt

          )
        }
    
        // Get frame length, optionally reading from follow-up bytes if indicated by special values.
        frameLength = (b1 and B1_MASK_LENGTH).toLong()
        if (frameLength == PAYLOAD_SHORT.toLong()) {
          frameLength = (source.readShort() and 0xffff).toLong() // Value is unsigned.
        } else if (frameLength == PAYLOAD_LONG.toLong()) {
          frameLength = source.readLong()
          if (frameLength < 0L) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  5. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerReader.kt

        if (bytesLeft == 0L) throw ProtocolException("unexpected length: $bytesLeft at $this")
        val byteArray = source.readByteArray(bytesLeft)
        return BigInteger(byteArray)
      }
    
      fun readLong(): Long {
        if (bytesLeft !in 1..8) throw ProtocolException("unexpected length: $bytesLeft at $this")
    
        var result = source.readByte().toLong() // No "and 0xff" because this is a signed value!
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  6. okcurl/src/main/kotlin/okhttp3/curl/Main.kt

        "--connect-timeout",
        help = "Maximum time allowed for connection (seconds)",
      ).int().default(DEFAULT_TIMEOUT)
    
      val readTimeout: Int by option("--read-timeout", help = "Maximum time allowed for reading data (seconds)").int().default(DEFAULT_TIMEOUT)
    
      val callTimeout: Int by option(
        "--call-timeout",
        help = "Maximum time allowed for the entire call (seconds)",
      ).int().default(DEFAULT_TIMEOUT)
    
    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 (1)
  7. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        val response = call.execute()
        val inputStream = response.body.byteStream()
        assertThat(inputStream.read().toChar()).isEqualTo('A')
        call.cancel()
        assertFailsWith<IOException> {
          // Reading 'B' may succeed if it's buffered.
          inputStream.read()
    
          // But 'C' shouldn't be buffered (the response is throttled) and this should fail.
          inputStream.read()
        }
        inputStream.close()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Reader.kt

          TYPE_SETTINGS -> readSettings(handler, length, flags, streamId)
          TYPE_PUSH_PROMISE -> readPushPromise(handler, length, flags, streamId)
          TYPE_PING -> readPing(handler, length, flags, streamId)
          TYPE_GOAWAY -> readGoAway(handler, length, flags, streamId)
          TYPE_WINDOW_UPDATE -> readWindowUpdate(handler, length, flags, streamId)
    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)
  9. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/HpackJsonUtil.kt

    import okio.ByteString
    import okio.ByteString.Companion.decodeHex
    import okio.FileSystem
    import okio.Path
    import okio.Path.Companion.toOkioPath
    import okio.buffer
    import okio.source
    
    /**
     * Utilities for reading HPACK tests.
     */
    object HpackJsonUtil {
      @Suppress("unused")
      private val MOSHI =
        Moshi.Builder()
          .add(
            object : Any() {
    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)
  10. docs/features/caching.md

            urlIterator.remove()
          }
        }
    ```
    
    ### Troubleshooting
    
    1. Valid cacheable responses are not being cached
    
    Make sure you are reading responses fully as unless they are read fully, cancelled or stalled Responses will not be cached.
    
    ### Overriding normal cache behaviour
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 3.1K bytes
    - Viewed (0)
Back to top