Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for BytesRead (0.19 sec)

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

              commit(upstreamPos)
              return -1L
            }
    
            // Update this source and prepare this call's result.
            val bytesRead = minOf(upstreamBytesRead, byteCount)
            upstreamBuffer.copyTo(sink, 0, bytesRead)
            sourcePos += bytesRead
    
            // Append the upstream bytes to the file.
            fileOperator!!.write(
              FILE_HEADER_SIZE + upstreamPos,
    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/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

                }
                throw e
              }
    
              if (bytesRead == -1L) {
                if (!cacheRequestClosed) {
                  cacheRequestClosed = true
                  cacheBody.close() // The cache response is complete!
                }
                return -1
              }
    
              sink.copyTo(cacheBody.buffer, sink.size - bytesRead, bytesRead)
              cacheBody.emitCompleteSegments()
              return bytesRead
    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)
  3. samples/guide/src/main/java/okhttp3/recipes/Progress.java

              long bytesRead = super.read(sink, byteCount);
              // read() returns the number of bytes read, or -1 if this source is exhausted.
              totalBytesRead += bytesRead != -1 ? bytesRead : 0;
              progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
              return bytesRead;
            }
          };
        }
      }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.9K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/ws/MessageInflater.kt

        val totalBytesToRead = inflater.bytesRead + deflatedBytes.size
    
        // We cannot read all, as the source does not close.
        // Instead, we ensure that all bytes from source have been processed by inflater.
        do {
          inflaterSource.readOrInflate(buffer, Long.MAX_VALUE)
        } while (inflater.bytesRead < totalBytesToRead && !inflater.finished())
      }
    
      @Throws(IOException::class)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  5. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerReader.kt

      private class CountingSource(source: Source) : ForwardingSource(source) {
        var bytesRead = 0L
    
        override fun read(
          sink: Buffer,
          byteCount: Long,
        ): Long {
          val result = delegate.read(sink, byteCount)
          if (result == -1L) return -1L
          bytesRead += result
          return result
        }
      }
    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. okhttp/src/main/kotlin/okhttp3/internal/cache2/FileOperator.kt

        }
        var mutablePos = pos
        var mutableByteCount = byteCount
    
        while (mutableByteCount > 0L) {
          val bytesRead = fileChannel.transferTo(mutablePos, mutableByteCount, sink)
          mutablePos += bytesRead
          mutableByteCount -= bytesRead
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/connection/Exchange.kt

      }
    
      fun <E : IOException?> bodyComplete(
        bytesRead: Long,
        responseDone: Boolean,
        requestDone: Boolean,
        e: E,
      ): E {
        if (e != null) {
          trackFailure(e)
        }
        if (requestDone) {
          if (e != null) {
            eventListener.requestFailed(call, e)
          } else {
            eventListener.requestBodyEnd(call, bytesRead)
          }
        }
        if (responseDone) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.2K bytes
    - Viewed (2)
  8. okhttp/src/test/java/okhttp3/internal/ws/MessageDeflaterInflaterTest.kt

      }
    
      /**
       * We had a bug where self-finishing inflater streams would infinite loop!
       * https://github.com/square/okhttp/issues/8078
       */
      @Test fun `inflate returns finished before bytesRead reaches input length`() {
        val inflater = MessageInflater(false)
        val message = "53621260020000".decodeHex()
        assertThat(inflater.inflate(message)).isEqualTo("22021002".decodeHex())
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 06 05:31:00 GMT 2024
    - 5K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/CallEvent.kt

        override val timestampNs: Long,
        override val call: Call,
      ) : CallEvent()
    
      data class ResponseBodyEnd(
        override val timestampNs: Long,
        override val call: Call,
        val bytesRead: Long,
      ) : CallEvent() {
        override fun closes(event: CallEvent): Boolean = event is ResponseBodyStart && call == event.call
      }
    
      data class ResponseFailed(
        override val timestampNs: Long,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/EventListenerTest.kt

        }
        if (responseBodyBytes != null) {
          val responseBodyEnd: ResponseBodyEnd = listener.removeUpToEvent<ResponseBodyEnd>()
          MatcherAssert.assertThat(
            "response body bytes",
            responseBodyEnd.bytesRead,
            responseBodyBytes,
          )
        } else {
          assertThat(listener.recordedEventTypes()).doesNotContain("ResponseBodyEnd")
        }
      }
    
      private fun greaterThan(value: Long): Matcher<Long?> {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 56.9K bytes
    - Viewed (0)
Back to top