Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for BufferedSink (0.04 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/UploadProgress.java

        public long contentLength() throws IOException {
          return delegate.contentLength();
        }
    
        @Override
        public void writeTo(BufferedSink sink) throws IOException {
          BufferedSink bufferedSink = Okio.buffer(sink(sink));
          delegate.writeTo(bufferedSink);
          bufferedSink.flush();
        }
    
        public Sink sink(Sink sink) {
          return new ForwardingSink(sink) {
            private long totalBytesWritten = 0L;
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 4.2K bytes
    - Viewed (1)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/UploadProgress.kt

                  completed = true
                  progressListener.update(totalBytesWritten, contentLength(), completed)
                }
              }
            }
    
          val bufferedSink = forwardingSink.buffer()
          delegate.writeTo(bufferedSink)
          bufferedSink.flush()
        }
      }
    
      fun interface ProgressListener {
        fun update(
          bytesWritten: Long,
          contentLength: Long,
          done: Boolean,
        )
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/internal/duplex/AsyncRequestBody.kt

    import okhttp3.MediaType
    import okhttp3.RequestBody
    import okio.BufferedSink
    import org.junit.jupiter.api.Assertions.assertTrue
    
    /** A duplex request body that keeps the provided sinks so they can be written to later.  */
    class AsyncRequestBody : RequestBody() {
      private val requestBodySinks: BlockingQueue<BufferedSink> = LinkedBlockingQueue()
    
      override fun contentType(): MediaType? = null
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/RequestBody.kt

    package okhttp3
    
    import java.io.File
    import java.io.FileDescriptor
    import java.io.FileInputStream
    import java.io.IOException
    import okhttp3.internal.checkOffsetAndCount
    import okhttp3.internal.chooseCharset
    import okio.BufferedSink
    import okio.ByteString
    import okio.FileSystem
    import okio.Path
    import okio.source
    
    abstract class RequestBody {
      /** Returns the Content-Type header for this body. */
      abstract fun contentType(): MediaType?
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 04 17:43:43 UTC 2025
    - 9K bytes
    - Viewed (0)
  5. okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingRequestBody.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3
    
    import java.io.IOException
    import okio.BufferedSink
    
    open class ForwardingRequestBody(
      delegate: RequestBody?,
    ) : RequestBody() {
      private val delegate: RequestBody
    
      fun delegate(): RequestBody = delegate
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/UppercaseRequestInterceptor.kt

     * limitations under the License.
     */
    package okhttp3
    
    import java.io.IOException
    import okhttp3.Interceptor.Chain
    import okio.Buffer
    import okio.BufferedSink
    import okio.ForwardingSink
    import okio.Sink
    import okio.buffer
    
    /** Rewrites the request body sent to the server to be all uppercase.  */
    class UppercaseRequestInterceptor : Interceptor {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  7. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerWriter.kt

     * limitations under the License.
     */
    package okhttp3.tls.internal.der
    
    import java.math.BigInteger
    import okio.Buffer
    import okio.BufferedSink
    import okio.ByteString
    
    internal class DerWriter(
      sink: BufferedSink,
    ) {
      /** A stack of buffers that will be concatenated once we know the length of each. */
      private val stack = mutableListOf(sink)
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    import okio.BufferedSink;
    
    public final class PostStreaming {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jul 06 03:18:15 UTC 2018
    - 2.1K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java

        private final Pipe pipe = new Pipe(8192);
        private final BufferedSink sink = Okio.buffer(pipe.sink());
    
        public BufferedSink sink() {
          return sink;
        }
    
        @Override public MediaType contentType() {
          return MEDIA_TYPE_MARKDOWN;
        }
    
        @Override public void writeTo(BufferedSink sink) throws IOException {
          sink.writeAll(pipe.source());
        }
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jul 06 03:18:15 UTC 2018
    - 3.1K bytes
    - Viewed (0)
  10. okhttp/src/commonJvmAndroid/kotlin/okhttp3/FormBody.kt

    import okhttp3.internal.toImmutableList
    import okhttp3.internal.url.FORM_ENCODE_SET
    import okhttp3.internal.url.canonicalizeWithCharset
    import okhttp3.internal.url.percentDecode
    import okio.Buffer
    import okio.BufferedSink
    
    class FormBody internal constructor(
      encodedNames: List<String>,
      encodedValues: List<String>,
    ) : RequestBody() {
      private val encodedNames: List<String> = encodedNames.toImmutableList()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 4.3K bytes
    - Viewed (0)
Back to top