Class ReadChannel

java.lang.Object
org.apache.arrow.vector.ipc.ReadChannel
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
SeekableReadChannel

public class ReadChannel extends Object implements AutoCloseable
Adapter around ReadableByteChannel that reads into ArrowBufs.
  • Constructor Details

  • Method Details

    • bytesRead

      public long bytesRead()
    • readFully

      public int readFully(ByteBuffer buffer) throws IOException
      Reads bytes into buffer until it is full (buffer.remaining() == 0). Returns the number of bytes read which can be less than full if there are no more.
      Parameters:
      buffer - The buffer to read to
      Returns:
      the number of byte read
      Throws:
      IOException - if nit enough bytes left to read
    • readFully

      public long readFully(ArrowBuf buffer, long length) throws IOException
      Reads up to len into buffer. Returns bytes read.
      Parameters:
      buffer - the buffer to read to
      length - the amount of bytes to read
      Returns:
      the number of bytes read
      Throws:
      IOException - if nit enough bytes left to read
    • close

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