Class FaultHideSink

java.lang.Object
org.miaixz.bus.core.io.sink.AssignSink
org.miaixz.bus.core.io.sink.FaultHideSink
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, Sink

public class FaultHideSink extends AssignSink
不会抛出IOExceptions的接收器, 即使底层接收器抛出了IOExceptions
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • FaultHideSink

      public FaultHideSink(Sink delegate)
  • Method Details

    • write

      public void write(Buffer source, long byteCount) throws IOException
      Description copied from interface: Sink
      Removes byteCount bytes from source and appends them to this.
      Specified by:
      write in interface Sink
      Overrides:
      write in class AssignSink
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Description copied from interface: Sink
      Pushes all buffered bytes to their final destination.
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in interface Sink
      Overrides:
      flush in class AssignSink
      Throws:
      IOException
    • close

      public void close() throws IOException
      Description copied from interface: 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.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Sink
      Overrides:
      close in class AssignSink
      Throws:
      IOException
    • onException

      protected void onException(IOException e)