- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for WriteAll (0.07 sec)
-
okhttp/src/main/kotlin/okhttp3/RequestBody.kt
override fun isOneShot(): Boolean = true override fun writeTo(sink: BufferedSink) { FileInputStream(this@toRequestBody).use { sink.buffer.writeAll(it.source()) } } } } /** Returns a new request body that transmits this. */ @JvmOverloads @JvmStatic @JvmName("create")
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Jan 25 14:41:37 UTC 2024 - 9.6K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/ws/MessageInflater.kt
@Throws(IOException::class) fun inflate(buffer: Buffer) { require(deflatedBytes.size == 0L) if (noContextTakeover) { inflater.reset() } deflatedBytes.writeAll(buffer) deflatedBytes.writeInt(OCTETS_TO_ADD_BEFORE_INFLATION) val totalBytesToRead = inflater.bytesRead + deflatedBytes.size // We cannot read all, as the source does not close.
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.8K bytes - Viewed (0) -
samples/static-server/src/main/java/okhttp3/sample/SampleServer.java
.setBody(fileToBytes(file)) .addHeader("content-type: " + contentType(path)); } private Buffer fileToBytes(File file) throws IOException { Buffer result = new Buffer(); result.writeAll(Okio.source(file)); return result; } private String contentType(String path) { if (path.endsWith(".png")) return "image/png"; if (path.endsWith(".jpg")) return "image/jpeg";
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Jan 02 02:50:44 UTC 2019 - 4.7K bytes - Viewed (0) -
mockwebserver/src/test/java/mockwebserver3/internal/http2/Http2Server.kt
responseHeaders = responseHeaders, outFinished = false, flushHeaders = false, ) file.source().use { source -> stream.getSink().buffer().use { sink -> sink.writeAll(source) } } } private fun contentType(file: File): String { return when { file.name.endsWith(".css") -> "text/css" file.name.endsWith(".gif") -> "image/gif"
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 6.1K bytes - Viewed (0) -
okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerWriter.kt
for (shift in (lengthByteCount - 1) * 8 downTo 0 step 8) { sink.writeByte((length shr shift).toInt()) } } // Write the payload. sink.writeAll(content) } /** * Execute [block] with a new namespace for type hints. Type hints from the enclosing type are no * longer usable by the current type's members. */
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 5.7K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java
return sink; } @Override public MediaType contentType() { return MEDIA_TYPE_MARKDOWN; } @Override public void writeTo(BufferedSink sink) throws IOException { sink.writeAll(pipe.source()); } } public static void main(String... args) throws Exception { new PostStreamingWithPipe().run(); }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Jul 06 03:18:15 UTC 2018 - 3.1K bytes - Viewed (0) -
cmd/storage-interface.go
CleanAbandonedData(ctx context.Context, volume string, path string) error // Write all data, syncs the data to disk. // Should be used for smaller payloads. WriteAll(ctx context.Context, volume string, path string, b []byte) (err error) // Read all. ReadAll(ctx context.Context, volume string, path string) (buf []byte, err error)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Aug 12 08:38:15 UTC 2024 - 5.2K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt
private suspend fun updateLocalFile() = withContext(Dispatchers.IO) { client.newCall(request).executeAsync().use { response -> fileSystem.sink(publicSuffixListDotDat).buffer().use { sink -> sink.writeAll(response.body.source()) } } } private suspend fun readImportResults(): ImportResults = withContext(Dispatchers.IO) { val sortedRules: SortedSet<ByteString> = TreeSet()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 18 01:24:38 UTC 2024 - 6K bytes - Viewed (0)