Package 

Class MobonOkio


  • 
    public final class MobonOkio
    
                        

    Essential APIs for working with MobonOkio.

    • Method Summary

      Modifier and Type Method Description
      static BufferedSource buffer(Source source) Returns a new source that buffers reads from {@code source}.
      static BufferedSink buffer(Sink sink) Returns a new sink that buffers writes to {@code sink}.
      static Sink sink(OutputStream out) Returns a sink that writes to {@code out}.
      static Sink sink(Socket socket) Returns a sink that writes to {@code socket}.
      static Source source(InputStream in) Returns a source that reads from {@code in}.
      static Source source(File file) Returns a source that reads from {@code file}.
      static Source source(Path path, Array<OpenOption> options) Returns a source that reads from {@code path}.
      static Sink sink(File file) Returns a sink that writes to {@code file}.
      static Sink appendingSink(File file) Returns a sink that appends to {@code file}.
      static Sink sink(Path path, Array<OpenOption> options) Returns a sink that writes to {@code path}.
      static Sink blackhole() Returns a sink that writes nowhere.
      static Source source(Socket socket) Returns a source that reads from {@code socket}.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • buffer

         static BufferedSource buffer(Source source)

        Returns a new source that buffers reads from {@code source}. The returnedsource will perform bulk reads into its in-memory buffer. Use this whereveryou read a source to get an ergonomic and efficient access to data.

      • buffer

         static BufferedSink buffer(Sink sink)

        Returns a new sink that buffers writes to {@code sink}. The returned sinkwill batch writes to {@code sink}. Use this wherever you write to a sink toget an ergonomic and efficient access to data.

      • sink

         static Sink sink(Socket socket)

        Returns a sink that writes to {@code socket}. Prefer this over because this method honors timeouts. When the socketwrite times out, the socket is asynchronously closed by a watchdog thread.

      • source

         static Source source(File file)

        Returns a source that reads from {@code file}.

      • sink

         static Sink sink(File file)

        Returns a sink that writes to {@code file}.

      • blackhole

         static Sink blackhole()

        Returns a sink that writes nowhere.

      • source

         static Source source(Socket socket)

        Returns a source that reads from {@code socket}. Prefer this over because this method honors timeouts. When the socketread times out, the socket is asynchronously closed by a watchdog thread.