public class FileChunkReader extends Object implements Closeable
RaftProtos.FileChunkProtos from a file.| Constructor and Description |
|---|
FileChunkReader(FileInfo info,
Path relativePath)
Construct a reader from a file specified by the given
FileInfo. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
org.apache.ratis.proto.RaftProtos.FileChunkProto |
readFileChunk(int chunkMaxSize)
Read the next chunk.
|
String |
toString() |
public FileChunkReader(FileInfo info, Path relativePath) throws IOException
FileInfo.info - the information of the file.relativePath - the relative path of the file.IOException - if it failed to open the file.public org.apache.ratis.proto.RaftProtos.FileChunkProto readFileChunk(int chunkMaxSize) throws IOException
chunkMaxSize - maximum chunk sizeIOException - if it failed to read the file.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2017–2023 The Apache Software Foundation. All rights reserved.