- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 33 for contentLength (0.16 sec)
-
okhttp/src/main/kotlin/okhttp3/internal/-ResponseBodyCommon.kt
sizeMapper: (T) -> Int, ): T { val contentLength = contentLength() if (contentLength > Int.MAX_VALUE) { throw IOException("Cannot buffer entire body for content length: $contentLength") } val bytes = source().use(consumer) val size = sizeMapper(bytes) if (contentLength != -1L && contentLength != size.toLong()) { throw IOException("Content-Length ($contentLength) and stream length ($size) disagree") }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 2.3K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/connection/Exchange.kt
fun createRequestBody( request: Request, duplex: Boolean, ): Sink { this.isDuplex = duplex val contentLength = request.body!!.contentLength() eventListener.requestBodyStart(call) val rawRequestBody = codec.createRequestBody(request, contentLength) return RequestBodySink(rawRequestBody, contentLength) } @Throws(IOException::class) fun flushRequest() { try { codec.flushRequest()
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 9.2K bytes - Viewed (2) -
okhttp/src/main/kotlin/okhttp3/internal/-ResponseCommon.kt
import okio.Source import okio.Timeout import okio.buffer internal class UnreadableResponseBody( private val mediaType: MediaType?, private val contentLength: Long, ) : ResponseBody(), Source { override fun contentType() = mediaType override fun contentLength() = contentLength override fun source() = buffer() override fun read( sink: Buffer, byteCount: Long, ): Long {
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Apr 15 13:24:48 GMT 2024 - 5.2K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/http/RealResponseBody.kt
* by malformed content types. */ private val contentTypeString: String?, private val contentLength: Long, private val source: BufferedSource, ) : ResponseBody() { override fun contentLength(): Long = contentLength override fun contentType(): MediaType? = contentTypeString?.toMediaTypeOrNull() override fun source(): BufferedSource = source
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.2K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/http/BridgeInterceptor.kt
if (contentType != null) { requestBuilder.header("Content-Type", contentType.toString()) } val contentLength = body.contentLength() if (contentLength != -1L) { requestBuilder.header("Content-Length", contentLength.toString()) requestBuilder.removeHeader("Transfer-Encoding") } else { requestBuilder.header("Transfer-Encoding", "chunked")
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 4.2K bytes - Viewed (2) -
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 May 03 11:42:14 GMT 2024 - Last Modified: Thu Jan 25 14:41:37 GMT 2024 - 9.6K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingResponseBody.kt
fun delegate(): ResponseBody { return delegate } override fun contentType(): MediaType? { return delegate.contentType() } override fun contentLength(): Long { return delegate.contentLength() } override fun source(): BufferedSource { return delegate.source() } override fun toString(): String { return javaClass.simpleName + "(" + delegate.toString() + ")"
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.2K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingRequestBody.kt
return delegate } override fun contentType(): MediaType? { return delegate.contentType() } @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()
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.4K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/-RequestBodyCommon.kt
byteCount: Int, ): RequestBody { checkOffsetAndCount(size.toLong(), offset.toLong(), byteCount.toLong()) 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")
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.7K bytes - Viewed (0) -
cmd/bucket-policy-handlers.go
return } // Error out if Content-Length is missing. // PutBucketPolicy always needs Content-Length. if r.ContentLength <= 0 { writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrMissingContentLength), r.URL) return } // Error out if Content-Length is beyond allowed size. if r.ContentLength > maxBucketPolicySize { writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPolicyTooLarge), r.URL) return }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Thu Apr 04 12:04:40 GMT 2024 - 6.1K bytes - Viewed (0)