Class BufferedChannel

java.lang.Object
org.gridgain.internal.snapshots.buffer.BufferedChannel
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, WritableByteChannel

public class BufferedChannel extends Object implements WritableByteChannel
Implementation of WritableByteChannel with intermediate byte buffer cache.
  • Constructor Details

  • Method Details

    • write

      public int write(ByteBuffer data) throws IOException
      Writes the provided bytes of data to the buffer with the eviction logic (writing) into the channel in case of buffer overflow.
      Specified by:
      write in interface WritableByteChannel
      Parameters:
      data - Byte buffer to write.
      Returns:
      The number of bytes written, possibly zero in case when buffer has space to persist data buffer.
      Throws:
      IOException - In case when channel throws exception on write.
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Channel
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Channel
      Specified by:
      close in interface Closeable
      Throws:
      IOException