Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 62 for byteCount (1.51 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/internal/io/FaultyFileSystem.kt

        sink: Sink,
        private val file: Path,
      ) : ForwardingSink(sink) {
        override fun write(
          source: Buffer,
          byteCount: Long,
        ) {
          if (writeFaults.contains(file)) {
            throw IOException("boom!")
          } else {
            super.write(source, byteCount)
          }
        }
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 2.8K bytes
    - Viewed (0)
  2. regression-test/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 Nov 13 07:09:56 UTC 2020
    - 2.5K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/SocksProxy.kt

            val buffer = Buffer()
            try {
              sink.use {
                source.use {
                  while (true) {
                    val byteCount = source.read(buffer, 8192L)
                    if (byteCount == -1L) break
                    sink.write(buffer, byteCount)
                    sink.emit()
                  }
                }
              }
            } catch (e: IOException) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon May 05 16:01:00 UTC 2025
    - 7.6K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt

          }
        }
    
      private fun uppercase(original: BufferedSink): Sink =
        object : ForwardingSink(original) {
          override fun write(
            source: Buffer,
            byteCount: Long,
          ) {
            original.writeUtf8(source.readUtf8(byteCount).uppercase())
          }
        }
    
      private fun gzip(data: String): Buffer {
        val result = Buffer()
        val sink = GzipSink(result).buffer()
        sink.writeUtf8(data)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 28.2K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/ResponseCommonTest.kt

            var closed = false
    
            override fun close() {
              closed = true
            }
    
            override fun read(
              sink: Buffer,
              byteCount: Long,
            ): Long {
              check(!closed)
              return data.read(sink, byteCount)
            }
    
            override fun timeout(): Timeout = Timeout.NONE
          }
        return source.buffer().asResponseBody(null, -1)
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

          printEvent("requestHeadersEnd");
        }
    
        @Override public void requestBodyStart(Call call) {
          printEvent("requestBodyStart");
        }
    
        @Override public void requestBodyEnd(Call call, long byteCount) {
          printEvent("requestBodyEnd");
        }
    
        @Override public void requestFailed(Call call, IOException ioe) {
          printEvent("requestFailed");
        }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Feb 16 23:20:49 UTC 2020
    - 5.3K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/ResponseBodyTest.kt

        assertThat(body.bytes()).isEqualTo(text)
      }
    }
    
    abstract class ForwardingSource(
      val delegate: Source,
    ) : Source {
      override fun read(
        sink: Buffer,
        byteCount: Long,
      ): Long = delegate.read(sink, byteCount)
    
      override fun timeout() = delegate.timeout()
    
      override fun close() = delegate.close()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 3.9K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/internal/cache2/FileOperatorTest.kt

          operator.write(0, buffer, -1L)
        }
        assertFailsWith<IndexOutOfBoundsException> {
          operator.write(0, buffer, 4L)
        }
      }
    
      private fun randomByteString(byteCount: Int): ByteString {
        val bytes = ByteArray(byteCount)
        Random(0).nextBytes(bytes)
        return ByteString.of(*bytes)
      }
    
      private fun snapshot(): ByteString {
        randomAccessFile!!.getChannel().force(false)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java

          printEvent("requestHeadersEnd");
        }
    
        @Override public void requestBodyStart(Call call) {
          printEvent("requestBodyStart");
        }
    
        @Override public void requestBodyEnd(Call call, long byteCount) {
          printEvent("requestBodyEnd");
        }
    
        @Override public void requestFailed(Call call, IOException ioe) {
          printEvent("requestFailed");
        }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Feb 16 23:20:49 UTC 2020
    - 6.1K bytes
    - Viewed (0)
  10. okhttp/src/jvmTest/kotlin/okhttp3/MultipartReaderTest.kt

          ),
        )
        val readBuff = Buffer()
        var byteCount = 0L
        while (true) {
          val readByteCount = onlyPart.body.read(readBuff, 1024L)
          if (readByteCount == -1L) break
          byteCount += readByteCount
          assertThat(readBuff.readUtf8()).isEqualTo("a".repeat(readByteCount.toInt()))
        }
        assertThat(byteCount).isEqualTo(1024L * 1024L * 100L)
        assertThat(multipartReader.nextPart()).isNull()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 02:11:14 UTC 2025
    - 15.4K bytes
    - Viewed (0)
Back to top