Package alluxio
Interface PositionReader
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
@ThreadSafe public interface PositionReader extends java.io.Closeable
Position read interface. All implementer should be thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Closes the positon reader and do cleanup job if any.default int
read(long position, byte[] buffer, int length)
default int
read(long position, byte[] buffer, int offset, int length)
default int
read(long position, ReadTargetBuffer buffer, int length)
default int
read(long position, io.netty.buffer.ByteBuf buffer, int length)
default int
read(long position, java.nio.ByteBuffer buffer, int length)
int
readInternal(long position, ReadTargetBuffer buffer, int length)
-
-
-
Method Detail
-
read
default int read(long position, byte[] buffer, int length) throws java.io.IOException
- Parameters:
position
- position of the file to start reading databuffer
- target byte arraylength
- bytes to read- Returns:
- bytes read, or -1 none of data is read
- Throws:
java.io.IOException
-
read
default int read(long position, byte[] buffer, int offset, int length) throws java.io.IOException
- Parameters:
position
- position of the file to start reading databuffer
- target byte arrayoffset
- the offset of the bufferlength
- bytes to read- Returns:
- bytes read, or -1 none of data is read
- Throws:
java.io.IOException
-
read
default int read(long position, java.nio.ByteBuffer buffer, int length) throws java.io.IOException
- Parameters:
position
- position of the file to start reading databuffer
- target byte bufferlength
- bytes to read- Returns:
- bytes read, or -1 none of data is read
- Throws:
java.io.IOException
-
read
default int read(long position, io.netty.buffer.ByteBuf buffer, int length) throws java.io.IOException
- Parameters:
position
- position of the file to start reading databuffer
- target byte buflength
- bytes to read- Returns:
- bytes read, or -1 none of data is read
- Throws:
java.io.IOException
-
read
default int read(long position, ReadTargetBuffer buffer, int length) throws java.io.IOException
- Parameters:
position
- position of the file to start reading databuffer
- target byte bufferlength
- bytes to read- Returns:
- bytes read, or -1 none of data is read
- Throws:
java.io.IOException
-
readInternal
int readInternal(long position, ReadTargetBuffer buffer, int length) throws java.io.IOException
- Parameters:
position
- position of the file to start reading databuffer
- target byte bufferlength
- bytes to read- Returns:
- bytes read, or -1 none of data is read
- Throws:
java.io.IOException
-
close
default void close() throws java.io.IOException
Closes the positon reader and do cleanup job if any.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-