| org.apache.commons.vfs.RandomAccessContent
All known Subclasses: org.apache.commons.vfs.util.MonitorRandomAccessContent, org.apache.commons.vfs.provider.AbstractRandomAccessContent, org.apache.commons.vfs.provider.ram.RamFileRandomAccessContent,
RandomAccessContent | public interface RandomAccessContent extends DataOutput,DataInput(Code) | | Description
author: Mario Ivankovits version: $Revision: 484946 $ $Date: 2006-12-09 00:18:52 -0800 (Sat, 09 Dec 2006) $ |
Method Summary | |
public void | close() Closes this random access file stream and releases any system
resources associated with the stream. | public long | getFilePointer() Returns the current offset in this file. | public InputStream | getInputStream() | public long | length() Returns the length of this file. | public void | seek(long pos) Sets the file-pointer offset, measured from the beginning of this
file, at which the next read or write occurs. |
close | public void close() throws IOException(Code) | | Closes this random access file stream and releases any system
resources associated with the stream. A closed random access
file cannot perform input or output operations and cannot be
reopened.
If this file has an associated channel then the channel is closed
as well.
throws: IOException - if an I/O error occurs. |
getFilePointer | public long getFilePointer() throws IOException(Code) | | Returns the current offset in this file.
the offset from the beginning of the file, in bytes,at which the next read or write occurs. throws: IOException - if an I/O error occurs. |
length | public long length() throws IOException(Code) | | Returns the length of this file.
the length of this file, measured in bytes. throws: IOException - if an I/O error occurs. |
seek | public void seek(long pos) throws IOException(Code) | | Sets the file-pointer offset, measured from the beginning of this
file, at which the next read or write occurs. The offset may be
set beyond the end of the file. Setting the offset beyond the end
of the file does not change the file length. The file length will
change only by writing after the offset has been set beyond the end
of the file.
Notice: If you use
RandomAccessContent.getInputStream() you have to reget the InputStream after calling
RandomAccessContent.seek(long)
Parameters: pos - the offset position, measured in bytes from thebeginning of the file, at which to set the filepointer. throws: IOException - if pos is less than0 or if an I/O error occurs. |
|
|