public class S3SeekableByteChannel extends Object implements SeekableByteChannel
| Constructor and Description |
|---|
S3SeekableByteChannel(S3Path path,
Set<? extends OpenOption> options)
Open or creates a file, returning a seekable byte channel
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isOpen() |
long |
position() |
SeekableByteChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
size() |
protected void |
sync()
try to sync the temp file with the remote s3 path.
|
SeekableByteChannel |
truncate(long size) |
int |
write(ByteBuffer src) |
public S3SeekableByteChannel(S3Path path, Set<? extends OpenOption> options) throws IOException
path - the path open or createoptions - options specifying how the file is openedIOException - if an I/O error occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionprotected void sync()
throws IOException
IOException - if the tempFile fails to open a newInputStreampublic int write(ByteBuffer src) throws IOException
write in interface SeekableByteChannelwrite in interface WritableByteChannelIOExceptionpublic SeekableByteChannel truncate(long size) throws IOException
truncate in interface SeekableByteChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelIOExceptionpublic SeekableByteChannel position(long newPosition) throws IOException
position in interface SeekableByteChannelIOExceptionpublic long position()
throws IOException
position in interface SeekableByteChannelIOExceptionCopyright © 2018. All rights reserved.