BufferedFSInputStream, CryptoFSDataInputStream, CryptoInputStream, FSDataInputStream, FSInputChecker, FSInputStream, FTPInputStream@Public
@Evolving
public interface PositionedReadable
Seekable.getPos() visible.| Modifier and Type | Method | Description |
|---|---|---|
default int |
maxReadSizeForVectorReads() |
What is the largest size that we should group ranges together as?
|
default int |
minSeekForVectorReads() |
What is the smallest reasonable seek?
|
int |
read(long position,
byte[] buffer,
int offset,
int length) |
Read up to the specified number of bytes, from a given
position within a file, and return the number of bytes read.
|
void |
readFully(long position,
byte[] buffer) |
Read number of bytes equal to the length of the buffer, from a given
position within a file.
|
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
Read the specified number of bytes, from a given
position within a file.
|
default void |
readVectored(java.util.List<? extends FileRange> ranges,
java.util.function.IntFunction<java.nio.ByteBuffer> allocate) |
Read fully a list of file ranges asynchronously from this file.
|
int read(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
position - position within filebuffer - destination bufferoffset - offset in the bufferlength - number of bytes to readjava.io.IOException - IO problems.void readFully(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
position - position within filebuffer - destination bufferoffset - offset in the bufferlength - number of bytes to readjava.io.IOException - IO problems.java.io.EOFException - the end of the data was reached before
the read operation completedvoid readFully(long position,
byte[] buffer)
throws java.io.IOException
position - position within filebuffer - destination bufferjava.io.IOException - IO problems.java.io.EOFException - the end of the data was reached before
the read operation completeddefault int minSeekForVectorReads()
default int maxReadSizeForVectorReads()
default void readVectored(java.util.List<? extends FileRange> ranges, java.util.function.IntFunction<java.nio.ByteBuffer> allocate) throws java.io.IOException
The position returned by getPos() after readVectored() is undefined.
If a file is changed while the readVectored() operation is in progress, the output is undefined. Some ranges may have old data, some may have new and some may have both.
While a readVectored() operation is in progress, normal read api calls may block.
ranges - the byte ranges to readallocate - the function to allocate ByteBufferjava.io.IOException - any IOE.java.lang.IllegalArgumentException - if the any of ranges are invalid, or they overlap.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.