public class S3ARemoteObjectReader extends Object implements Closeable
Constructor and Description |
---|
S3ARemoteObjectReader(S3ARemoteObject remoteObject)
Constructs an instance of
S3ARemoteObjectReader . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
read(ByteBuffer buffer,
long offset,
int size)
Stars reading at
offset and reads upto size bytes into buffer . |
public S3ARemoteObjectReader(S3ARemoteObject remoteObject)
S3ARemoteObjectReader
.remoteObject
- The S3 file to read.IllegalArgumentException
- if remoteObject is null.public int read(ByteBuffer buffer, long offset, int size) throws IOException
offset
and reads upto size
bytes into buffer
.buffer
- the buffer into which data is returnedoffset
- the absolute offset into the underlying file where reading starts.size
- the number of bytes to be read.IOException
- if there is an error reading from the file.IllegalArgumentException
- if buffer is null.IllegalArgumentException
- if offset is outside of the range [0, file size].IllegalArgumentException
- if size is zero or negative.public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.