Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for fileToBytes (0.05 sec)

  1. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

      private MockResponse fileToResponse(String path, File file) throws IOException {
        return new MockResponse()
            .setStatus("HTTP/1.1 200")
            .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;
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Jan 02 02:50:44 UTC 2019
    - 4.7K bytes
    - Viewed (0)
Back to top