Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 2 of 2 for WriteAll (0.05 seconds)

  1. 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";
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Wed Mar 11 02:37:00 GMT 2026
    - 5.3K bytes
    - Click Count (0)
  2. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

                    socket = socket,
                    stream = stream,
                  ).buffer()
              requestBodySink.use {
                it.writeAll(stream.source)
              }
            } catch (e: IOException) {
              exception = e
            } finally {
              bodyByteString = body.readByteString()
            }
          }
    
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 40.3K bytes
    - Click Count (0)
Back to Top