public abstract class AbstractNIOHandle extends Object implements IRandomAccess
IRandomAccess
,
RandomAccessFile
Modifier and Type | Field and Description |
---|---|
protected static String |
EOF_ERROR_MSG
Error message to be used when instantiating an EOFException.
|
Constructor and Description |
---|
AbstractNIOHandle() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
setLength(long length)
Sets the new length of the handle.
|
protected boolean |
validateLength(int writeLength)
Ensures that the handle has the correct length to be written to and
extends it as required.
|
protected void |
validateMode(String mode)
Ensures that the file mode is either "r" or "rw".
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getFilePointer, getOrder, length, read, read, read, read, seek, setOrder, write, write
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
protected static final String EOF_ERROR_MSG
protected void validateMode(String mode)
mode
- Mode to validate.IllegalArgumentException
- If an illegal mode is passed.protected boolean validateLength(int writeLength) throws IOException
writeLength
- Number of bytes to write.true
if the buffer has not required an extension.
false
otherwise.IOException
- If there is an error changing the handle's length.protected abstract void setLength(long length) throws IOException
length
- New length.IOException
- If there is an error changing the handle's length.Copyright © 2015 Open Microscopy Environment