Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for WriteTo (0.17 sec)

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

              url = server.url("/"),
              body =
                object : ForwardingRequestBody(transferKind.newRequestBody("def")) {
                  override fun writeTo(sink: BufferedSink) {
                    sinkReference.set(sink)
                    super.writeTo(sink)
                  }
                },
            ),
          )
        assertThat(readAscii(response.body.byteStream(), Int.MAX_VALUE))
          .isEqualTo("abc")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/CallTest.kt

        // Call 1: set a deadline on the request body.
        val requestBody1: RequestBody =
          object : RequestBody() {
            override fun contentType(): MediaType = "text/plain".toMediaType()
    
            override fun writeTo(sink: BufferedSink) {
              sink.writeUtf8("abc")
              sink.timeout().deadline(5, TimeUnit.SECONDS)
            }
          }
        val request1 =
          Request.Builder()
            .url(server.url("/"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/CacheTest.kt

      ): MockResponse.Builder {
        val response = builder.build()
        builder.socketPolicy(DisconnectAtEnd)
        val headers = response.headers
        val fullBody = Buffer()
        response.body!!.writeTo(fullBody)
        val truncatedBody = Buffer()
        truncatedBody.write(fullBody, numBytesToKeep.toLong())
        builder.body(truncatedBody)
        builder.headers(headers)
        return builder
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
Back to top