类 Okio
java.lang.Object
com.lark.oapi.okio.Okio
Essential APIs for working with Okio.
-
方法概要
修饰符和类型方法说明static SinkappendingSink(File file) Returns a sink that appends tofile.static SinkReturns a sink that writes nowhere.static BufferedSinkReturns a new sink that buffers writes tosink.static BufferedSourceReturns a new source that buffers reads fromsource.static SinkReturns a sink that writes tofile.static Sinksink(OutputStream out) Returns a sink that writes toout.static SinkReturns a sink that writes tosocket.static Sinksink(Path path, OpenOption... options) Returns a sink that writes topath.static SourceReturns a source that reads fromfile.static Sourcesource(InputStream in) Returns a source that reads fromin.static SourceReturns a source that reads fromsocket.static Sourcesource(Path path, OpenOption... options) Returns a source that reads frompath.
-
方法详细资料
-
buffer
Returns a new source that buffers reads fromsource. The returned source will perform bulk reads into its in-memory buffer. Use this wherever you read a source to get an ergonomic and efficient access to data. -
buffer
Returns a new sink that buffers writes tosink. The returned sink will batch writes tosink. Use this wherever you write to a sink to get an ergonomic and efficient access to data. -
sink
Returns a sink that writes toout. -
sink
Returns a sink that writes tosocket. Prefer this oversink(OutputStream)because this method honors timeouts. When the socket write times out, the socket is asynchronously closed by a watchdog thread.- 抛出:
IOException
-
source
Returns a source that reads fromin. -
source
Returns a source that reads fromfile. -
source
@IgnoreJRERequirement public static Source source(Path path, OpenOption... options) throws IOException Returns a source that reads frompath.- 抛出:
IOException
-
sink
Returns a sink that writes tofile. -
appendingSink
Returns a sink that appends tofile. -
sink
Returns a sink that writes topath.- 抛出:
IOException
-
blackhole
Returns a sink that writes nowhere. -
source
Returns a source that reads fromsocket. Prefer this oversource(InputStream)because this method honors timeouts. When the socket read times out, the socket is asynchronously closed by a watchdog thread.- 抛出:
IOException
-