Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 51 for WriteTo (0.18 sec)

  1. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

        assertOnFileDescriptor(content = "Hello") { fd ->
          val requestBody = fd.toRequestBody()
    
          val buffer = Buffer()
          requestBody.writeTo(buffer)
          assertThat(buffer.readUtf8()).isEqualTo("Hello")
    
          assertThrows(IOException::class.java) {
            requestBody.writeTo(Buffer())
          }
        }
      }
    
      @Test
      fun testFileDescriptorAfterClose() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (1)
  2. okhttp/src/test/java/okhttp3/MultipartBodyTest.kt

        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
      }
    
      @Test
      fun streamingPartHasNoLength() {
        class StreamingBody(private val body: String) : RequestBody() {
          override fun contentType(): MediaType? {
            return null
          }
    
          @Throws(IOException::class)
          override fun writeTo(sink: BufferedSink) {
            sink.writeUtf8(body)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingRequestBody.kt

      }
    
      @Throws(IOException::class)
      override fun contentLength(): Long {
        return delegate.contentLength()
      }
    
      @Throws(IOException::class)
      override fun writeTo(sink: BufferedSink) {
        delegate.writeTo(sink)
      }
    
      override fun isDuplex(): Boolean {
        return delegate.isDuplex()
      }
    
      override fun toString(): String {
        return javaClass.simpleName + "(" + delegate.toString() + ")"
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/-RequestBodyCommon.kt

      return object : RequestBody() {
        override fun contentType() = contentType
    
        override fun contentLength() = byteCount.toLong()
    
        override fun writeTo(sink: BufferedSink) {
          sink.write(this@commonToRequestBody, offset, byteCount)
        }
      }
    }
    
    @Suppress("unused")
    fun RequestBody.commonContentLength(): Long = -1L
    
    @Suppress("unused")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/RequestBody.kt

      /**
       * Returns the number of bytes that will be written to sink in a call to [writeTo],
       * or -1 if that count is unknown.
       */
      @Throws(IOException::class)
      open fun contentLength(): Long = commonContentLength()
    
      /** Writes the content of this request to [sink]. */
      @Throws(IOException::class)
      abstract fun writeTo(sink: BufferedSink)
    
      /**
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Jan 25 14:41:37 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/FormBodyTest.kt

        val out = Buffer()
        body.writeTo(out)
        assertThat(out.readUtf8()).isEqualTo(expected)
      }
    
      @Test
      fun encodedPair() {
        val body =
          FormBody.Builder()
            .add("sim", "ple")
            .build()
        val expected = "sim=ple"
        assertThat(body.contentLength()).isEqualTo(expected.length.toLong())
        val buffer = Buffer()
        body.writeTo(buffer)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

          )
    
        call.execute().use { response ->
          assertThat(response.body.string()).isEqualTo("abc")
          val requestBodyOut = requestBody.takeSink()
          assertFailsWith<IOException> {
            SlowRequestBody.writeTo(requestBodyOut)
          }
          assertFailsWith<IOException> {
            requestBodyOut.close()
          }
        }
    
        // Confirm that the connection pool was not corrupted by making another call.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  8. okhttp-testing-support/src/main/kotlin/okhttp3/UppercaseRequestInterceptor.kt

        val uppercaseBody: RequestBody =
          object : ForwardingRequestBody(request.body) {
            @Throws(IOException::class)
            override fun writeTo(sink: BufferedSink) {
              delegate().writeTo(uppercaseSink(sink).buffer())
            }
          }
        return request.newBuilder()
          .method(request.method, uppercaseBody)
          .build()
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  9. src/archive/tar/reader.go

    	if err != nil && err != io.EOF {
    		tr.err = err
    	}
    	return n, err
    }
    
    // writeTo writes the content of the current file to w.
    // The bytes written matches the number of remaining bytes in the current file.
    //
    // If the current file is sparse and w is an io.WriteSeeker,
    // then writeTo uses Seek to skip past holes defined in Header.SparseHoles,
    // assuming that skipped regions are filled with NULs.
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/http/CallServerInterceptor.kt

                requestBody.writeTo(bufferedRequestBody)
              } else {
                // Write the request body if the "Expect: 100-continue" expectation was met.
                val bufferedRequestBody = exchange.createRequestBody(request, false).buffer()
                requestBody.writeTo(bufferedRequestBody)
                bufferedRequestBody.close()
              }
            } else {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.3K bytes
    - Viewed (1)
Back to top