### Question:
Okio { public static Sink sink(OutputStream out) { return sink(out, new Timeout()); } private  Okio(); static BufferedSource buffer(Source source); static BufferedSink buffer(Sink sink); static Sink sink(OutputStream out); static Sink sink(Socket socket); static Source source(InputStream in); static Source source(File file); static Sink sink(File file); static Sink appendingSink(File file); static Source source(Socket socket);  }### Answer:
@Test public void sinkFromOutputStream() throws Exception { Buffer data = new Buffer(); data.writeUtf8("a"); data.writeUtf8(repeat('b', 9998)); data.writeUtf8("c"); ByteArrayOutputStream out = new ByteArrayOutputStream(); Sink sink = Okio.sink(out); sink.write(data, 3); assertEquals("abb", out.toString("UTF-8")); sink.write(data, data.size()); assertEquals("a" + repeat('b', 9998) + "c", out.toString("UTF-8")); }