类 DeflaterSink

java.lang.Object
com.lark.oapi.okio.DeflaterSink
所有已实现的接口:
Sink, Closeable, Flushable, AutoCloseable

public final class DeflaterSink extends Object implements Sink
A sink that uses DEFLATE to compress data written to another source.

Sync flush

Aggressive flushing of this stream may result in reduced compression. Each call to flush() immediately compresses all currently-buffered data; this early compression may be less effective than compression performed without flushing.

This is equivalent to using Deflater with the sync flush option. This class does not offer any partial flush mechanism. For best performance, only call flush() when application behavior requires it.

  • 构造器详细资料

    • DeflaterSink

      public DeflaterSink(Sink sink, Deflater deflater)
  • 方法详细资料

    • write

      public void write(Buffer source, long byteCount) throws IOException
      从接口复制的说明: Sink
      Removes byteCount bytes from source and appends them to this.
      指定者:
      write 在接口中 Sink
      抛出:
      IOException
    • flush

      public void flush() throws IOException
      从接口复制的说明: Sink
      Pushes all buffered bytes to their final destination.
      指定者:
      flush 在接口中 Flushable
      指定者:
      flush 在接口中 Sink
      抛出:
      IOException
    • close

      public void close() throws IOException
      从接口复制的说明: Sink
      Pushes all buffered bytes to their final destination and releases the resources held by this sink. It is an error to write a closed sink. It is safe to close a sink more than once.
      指定者:
      close 在接口中 AutoCloseable
      指定者:
      close 在接口中 Closeable
      指定者:
      close 在接口中 Sink
      抛出:
      IOException
    • timeout

      public Timeout timeout()
      从接口复制的说明: Sink
      Returns the timeout for this sink.
      指定者:
      timeout 在接口中 Sink
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object