public interface RandomAccessContent
extends java.io.DataOutput, java.io.DataInput
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this random access file stream and releases any system
resources associated with the stream.
|
long |
getFilePointer()
Returns the current offset in this file.
|
java.io.InputStream |
getInputStream()
get the input stream
Notice: If you use seek(long) you have to reget the InputStream |
long |
length()
Returns the length of this file.
|
void |
seek(long pos)
Sets the file-pointer offset, measured from the beginning of this
file, at which the next read or write occurs.
|
long getFilePointer() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.void seek(long pos) throws java.io.IOException
getInputStream()
you have to reget the InputStream after calling seek(long)
pos
- the offset position, measured in bytes from the
beginning of the file, at which to set the file
pointer.java.io.IOException
- if pos
is less than
0
or if an I/O error occurs.long length() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.void close() throws java.io.IOException
If this file has an associated channel then the channel is closed as well.
java.io.IOException
- if an I/O error occurs.java.io.InputStream getInputStream() throws java.io.IOException
seek(long)
you have to reget the InputStreamjava.io.IOException