Class TarSeekableByteChannel
java.lang.Object
org.epics.archiverappliance.utils.nio.tar.TarSeekableByteChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel
Wraps a SeekableByteChannel and takes some actions when the channel is closed.
For reads, this is mostly cleanup
For writes, this updates the tar file and then does cleanup.
-
Constructor Summary
ConstructorsConstructorDescriptionTarSeekableByteChannel(Closeable streamToClose, FileChannel proxied, TarEntry tarEntry, TarFileSystem gfs, File fileToAppend, Path deletFileOnClose) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanisOpen()longposition()position(long newPosition) intread(ByteBuffer dst) longsize()truncate(long size) intwrite(ByteBuffer src)
-
Constructor Details
-
TarSeekableByteChannel
public TarSeekableByteChannel(Closeable streamToClose, FileChannel proxied, TarEntry tarEntry, TarFileSystem gfs, File fileToAppend, Path deletFileOnClose)
-
-
Method Details
-
isOpen
public boolean isOpen() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
size
- Specified by:
sizein interfaceSeekableByteChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Throws:
IOException
-