Class RandomAccessFileData
java.lang.Object
org.hansken.plugin.extraction.test.serialize.RandomAccessFileData
- All Implemented Interfaces:
Closeable,AutoCloseable,RandomAccessData
A
RandomAccessData implementation which reads from an in-memory
byte array. Closing it has the effect of removing the reference to the array.
Note: this implementation is not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionRandomAccessFileData(File file) Create a new instance reading from given file. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hansken.plugin.extraction.api.RandomAccessData
read, read, readNBytes, remaining
-
Constructor Details
-
RandomAccessFileData
Create a new instance reading from given file.- Parameters:
file- the file to read data from- Throws:
FileNotFoundException- if the file does not exist
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
size
public long size()- Specified by:
sizein interfaceRandomAccessData
-
position
public long position()- Specified by:
positionin interfaceRandomAccessData
-
seek
- Specified by:
seekin interfaceRandomAccessData- Throws:
IOException
-
read
- Specified by:
readin interfaceRandomAccessData- Throws:
IOException
-