public class Adler32CheckedFileIO extends CheckedFileIO
Modifier and Type | Field and Description |
---|---|
static short |
ADLER_SUPER_BLOCK_LENGTH_MAX
The maximum super block length supported for algorithm ADLER.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the file channel
|
void |
flush()
Flush method is used to flush the file onto storage.
|
long |
position()
Returns this channel's file relative position.
|
void |
position(long newPosition)
Sets this channel's file position from the input relative position.
|
void |
read(ByteBuffer dst,
long position)
Read data from the channel to the given byte buffer from the input relative position until there are no bytes
remaining in the buffer or the end of the file has been reached.
|
long |
size()
Size of file channel based on relative position.
|
String |
toString() |
void |
truncate(long size)
Truncate file channel to given size based on relative position.
|
boolean |
validate()
Validate compares with the value stored in header of the file with the checksum computed of the entire file.
|
void |
write(ByteBuffer src)
Write the given buffer into the file channel at the relative file channel position
NOTE: File position is updated with the number of bytes written
|
void |
write(ByteBuffer src,
long position)
Write the given buffer into the file channel at the input relative position in file channel.
|
checksum, create, isValidPath, migrateFile, open, open, openOrCreate, openOrCreate, transferFrom, transferTo, validPath, verifyOnlyValidFileExists
public static final short ADLER_SUPER_BLOCK_LENGTH_MAX
public boolean validate() throws IOException, InstantiationException, IllegalAccessException
CheckedFileIO
validate
in class CheckedFileIO
IOException
- If any I/O error occursInstantiationException
IllegalAccessException
public void read(ByteBuffer dst, long position) throws IOException
CheckedFileIO
read
in class CheckedFileIO
dst
- The byte buffer to which bytes are to be transferredposition
- The file position at which the transfer is to beginIOException
- If any I/O error occurspublic void write(ByteBuffer src) throws IOException
CheckedFileIO
write
in class CheckedFileIO
src
- The buffer from which bytes are to be transferredIOException
- If any I/O error occurspublic void write(ByteBuffer src, long position) throws IOException
CheckedFileIO
write
in class CheckedFileIO
src
- The buffer from which bytes are to be transferredposition
- The file position at which the transfer is to beginIOException
- If any I/O error occurspublic long position() throws IOException
CheckedFileIO
position
in class CheckedFileIO
IOException
- If any I/O error occurspublic void position(long newPosition) throws IOException
CheckedFileIO
position
in class CheckedFileIO
newPosition
- The new positionIOException
- If any I/O error occurspublic long size() throws IOException
CheckedFileIO
size
in class CheckedFileIO
IOException
- If any I/O error occurspublic void truncate(long size) throws IOException
CheckedFileIO
truncate
in class CheckedFileIO
size
- The new size of file channelIOException
- If any I/O error occurspublic void flush() throws IOException
CheckedFileIO
flush
in class CheckedFileIO
IOException
- If any I/O error occurspublic void close() throws IOException
CheckedFileIO
close
in interface AutoCloseable
close
in class CheckedFileIO
IOException
- If any I/O error occurs