Class TarReadOnlyByteChannel
java.lang.Object
org.epics.archiverappliance.utils.nio.tar.TarReadOnlyByteChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel
Wraps a SeekableByteChannel to present a read only view of the tar entry.
tar.dataoffset() is the offset of the start of the data in the tar file, and tar.size() is the size of the data.
The position of the channel is relative to the start of the tar file, so we need to adjust the position and limit of the channel to present a view of the tar entry data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanisOpen()longposition()position(long newPosition) intread(ByteBuffer dst) longsize()truncate(long size) intwrite(ByteBuffer src)
-
Constructor Details
-
TarReadOnlyByteChannel
- Throws:
IOException
-
-
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
-