Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for WriteTo (0.3 sec)

  1. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  2. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

            } else if (requestBody.isOneShot()) {
              logger.log("--> END ${request.method} (one-shot body omitted)")
            } else {
              var buffer = Buffer()
              requestBody.writeTo(buffer)
    
              var gzippedLength: Long? = null
              if ("gzip".equals(headers["Content-Encoding"], ignoreCase = true)) {
                gzippedLength = buffer.size
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  3. okhttp/src/main/kotlin/okhttp3/Cache.kt

          return null
        }
    
        val entry = Entry(response)
        var editor: DiskLruCache.Editor? = null
        try {
          editor = cache.edit(key(response.request.url)) ?: return null
          entry.writeTo(editor)
          return RealCacheRequest(editor)
        } catch (_: IOException) {
          abortQuietly(editor)
          return null
        }
      }
    
      @Throws(IOException::class)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  4. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

        setLevel(Level.HEADERS)
        server.enqueue(MockResponse())
        val body: RequestBody =
          object : RequestBody() {
            override fun contentType() = PLAIN
    
            override fun writeTo(sink: BufferedSink) {
              sink.writeUtf8("Hi!")
            }
          }
        val response = client.newCall(request().post(body).build()).execute()
        response.body.close()
        applicationLogs
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/MultipartReaderTest.kt

            .addFormDataPart("color", "Brown")
            .addFormDataPart("animal", "fox.txt", "Fox".toRequestBody())
            .build()
    
        val bodyContent = Buffer()
        body.writeTo(bodyContent)
    
        val reader = MultipartReader(bodyContent, "boundary")
    
        val quickPart = reader.nextPart()!!
        assertThat(quickPart.headers).isEqualTo(
          headersOf(
            "Content-Type",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.8K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/DuplexTest.kt

        override fun contentType() = delegate.contentType()
    
        override fun isDuplex() = true
    
        override fun writeTo(sink: BufferedSink) {
          executorService.schedule({
            try {
              delegate.writeTo(sink)
              sink.close()
            } catch (e: IOException) {
              throw RuntimeException(e)
            }
          }, delayMillis, TimeUnit.MILLISECONDS)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/MultipartBody.kt

        var result = contentLength
        if (result == -1L) {
          result = writeOrCountBytes(null, true)
          contentLength = result
        }
        return result
      }
    
      @Throws(IOException::class)
      override fun writeTo(sink: BufferedSink) {
        writeOrCountBytes(sink, false)
      }
    
      /**
       * Either writes this request to [sink] or measures its content length. We have one method do
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt

        return object : RequestBody() {
          override fun contentType(): MediaType? {
            return "text/plain".toMediaTypeOrNull()
          }
    
          @Throws(IOException::class)
          override fun writeTo(sink: BufferedSink) {
            try {
              sink.writeUtf8("abc")
              sink.flush()
              Thread.sleep(sleepMillis.toLong())
              sink.writeUtf8("def")
            } catch (e: InterruptedException) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/InterceptorTest.kt

          }
    
          override fun contentLength(): Long {
            return original!!.contentLength()
          }
    
          override fun writeTo(sink: BufferedSink) {
            val uppercase = uppercase(sink)
            val bufferedSink = uppercase.buffer()
            original!!.writeTo(bufferedSink)
            bufferedSink.emit()
          }
        }
      }
    
      private fun uppercase(original: BufferedSink): Sink {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 27.8K bytes
    - Viewed (0)
  10. mockwebserver/api/mockwebserver3.api

    }
    
    public final class mockwebserver3/MockResponse$Companion {
    }
    
    public abstract interface class mockwebserver3/MockResponseBody {
    	public abstract fun getContentLength ()J
    	public abstract fun writeTo (Lokio/BufferedSink;)V
    }
    
    public final class mockwebserver3/MockWebServer : java/io/Closeable {
    	public static final field Companion Lmockwebserver3/MockWebServer$Companion;
    	public fun <init> ()V
    	public fun close ()V
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 03 21:59:45 GMT 2023
    - 12.7K bytes
    - Viewed (0)
Back to top