Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for readLong (0.33 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. mockwebserver/src/main/kotlin/mockwebserver3/SocketPolicy.kt

       */
      object DisconnectAtEnd : SocketPolicy
    
      /**
       * Request immediate close of connection without even reading the request. Use to simulate buggy
       * SSL servers closing connections in response to unrecognized TLS extensions.
       */
      object DisconnectAtStart : SocketPolicy
    
      /**
       * Close connection after reading the request but before writing the response. Use this to
       * simulate late connection pool failures.
       */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http1/Http1ExchangeCodec.kt

        check(state == STATE_OPEN_RESPONSE_BODY) { "state: $state" }
        state = STATE_READING_RESPONSE_BODY
        return FixedLengthSource(length)
      }
    
      private fun newChunkedSource(url: HttpUrl): Source {
        check(state == STATE_OPEN_RESPONSE_BODY) { "state: $state" }
        state = STATE_READING_RESPONSE_BODY
        return ChunkedSource(url)
      }
    
      private fun newUnknownLengthSource(): Source {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 16.2K bytes
    - Viewed (0)
  10. docs/contribute/concurrency.md

    Consider an application streaming a video over http/2. Perhaps the user pauses the video and the application stops reading bytes from this stream. The buffer will fill up, and flow control prevents the server from sending more data on this stream. When the user unpauses her video the buffer drains, the read is acknowledged, and the server proceeds to stream data.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 16:35:36 GMT 2022
    - 7K bytes
    - Viewed (0)
Back to top