Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 62 for byteCount (0.05 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingEventListener.kt

        request: Request,
      ) = logEvent(RequestHeadersEnd(System.nanoTime(), call, request.headers.byteCount()))
    
      override fun requestBodyStart(call: Call) = logEvent(RequestBodyStart(System.nanoTime(), call))
    
      override fun requestBodyEnd(
        call: Call,
        byteCount: Long,
      ) = logEvent(RequestBodyEnd(System.nanoTime(), call, byteCount))
    
      override fun requestFailed(
        call: Call,
        ioe: IOException,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:58:02 UTC 2025
    - 9.5K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/HeadersJvmTest.kt

    import okhttp3.Headers.Companion.toHeaders
    import org.junit.jupiter.api.Test
    
    class HeadersJvmTest {
      @Test fun byteCount() {
        assertThat(Headers.EMPTY.byteCount()).isEqualTo(0L)
        assertThat(
          Headers
            .Builder()
            .add("abc", "def")
            .build()
            .byteCount(),
        ).isEqualTo(10L)
        assertThat(
          Headers
            .Builder()
            .add("abc", "def")
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:51:25 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  3. mockwebserver/src/main/kotlin/mockwebserver3/internal/TriggerSink.kt

    ) : Sink by delegate {
      private var bytesWritten = 0L
    
      override fun write(
        source: Buffer,
        byteCount: Long,
      ) {
        if (byteCount == 0L) return // Avoid double-triggering.
    
        if (bytesWritten == triggerByteCount) {
          source.skip(byteCount)
          return
        }
    
        val toWrite = minOf(byteCount, triggerByteCount - bytesWritten)
        bytesWritten += toWrite
    
        delegate.write(source, toWrite)
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/MultipartReader.kt

          }
    
          override fun read(
            sink: Buffer,
            byteCount: Long,
          ): Long {
            require(byteCount >= 0L) { "byteCount < 0: $byteCount" }
            check(currentPart == this) { "closed" }
    
            return source.timeout().intersectWith(timeout) {
              when (val limit = currentPartBytesRemaining(maxByteCount = byteCount)) {
                0L -> -1L // No more bytes in this part.
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 02:11:14 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  5. android-test/src/androidTest/README.md

    01-01 12:53:32.811 10999 11089 D OkHttp  : [49 ms] responseBodyStart
    01-01 12:53:32.811 10999 11089 D OkHttp  : [49 ms] responseBodyEnd: byteCount=128
    01-01 12:53:32.811 10999 11089 D OkHttp  : [49 ms] connectionReleased
    01-01 12:53:32.811 10999 11089 D OkHttp  : [49 ms] callEnd
    01-01 12:53:32.816 10999 11090 D OkHttp  : [54 ms] responseHeadersStart
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Aug 22 08:12:58 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  6. okhttp/src/commonJvmAndroid/kotlin/okhttp3/MultipartBody.kt

          sink.write(CRLF)
    
          if (countBytes) {
            byteCount += contentLength
          } else {
            body.writeTo(sink)
          }
    
          sink.write(CRLF)
        }
    
        sink!!.write(DASHDASH)
        sink.write(boundaryByteString)
        sink.write(DASHDASH)
        sink.write(CRLF)
    
        if (countBytes) {
          byteCount += byteCountBuffer!!.size
          byteCountBuffer.clear()
        }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  7. okhttp/src/commonJvmAndroid/kotlin/okhttp3/RequestBody.kt

          contentType: MediaType? = null,
          offset: Int = 0,
          byteCount: Int = size,
        ): RequestBody {
          checkOffsetAndCount(size.toLong(), offset.toLong(), byteCount.toLong())
          return object : RequestBody() {
            override fun contentType() = contentType
    
            override fun contentLength() = byteCount.toLong()
    
            override fun writeTo(sink: BufferedSink) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 04 17:43:43 UTC 2025
    - 9K bytes
    - Viewed (0)
  8. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache2/Relay.kt

              val bytesToRead = minOf(byteCount, upstreamPos - sourcePos)
              buffer.copyTo(sink, sourcePos - bufferPos, bytesToRead)
              sourcePos += bytesToRead
              return bytesToRead
            }
    
          // Read from the file.
          if (source == SOURCE_FILE) {
            val bytesToRead = minOf(byteCount, upstreamPos - sourcePos)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 17:15:47 UTC 2025
    - 11.8K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/UploadProgress.java

            private long totalBytesWritten = 0L;
            private boolean completed = false;
    
            @Override
            public void write(Buffer source, long byteCount) throws IOException {
              super.write(source, byteCount);
              totalBytesWritten += byteCount;
              progressListener.update(totalBytesWritten, contentLength(), completed);
            }
    
            @Override
            public void close() throws IOException {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 4.2K bytes
    - Viewed (1)
  10. mockwebserver/src/main/kotlin/mockwebserver3/internal/ThrottledSink.kt

      private val bytesPerPeriod: Long,
      private val periodDelayNanos: Long,
    ) : Sink by delegate {
      private var bytesWrittenSinceLastDelay = 0L
    
      override fun write(
        source: Buffer,
        byteCount: Long,
      ) {
        var bytesLeft = byteCount
    
        while (bytesLeft > 0) {
          if (bytesWrittenSinceLastDelay == bytesPerPeriod) {
            flush()
            socket.sleepWhileOpen(periodDelayNanos)
            bytesWrittenSinceLastDelay = 0
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 12:43:16 UTC 2025
    - 1.5K bytes
    - Viewed (0)
Back to top