|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Method Summary | |
int |
getFilePosition()
Deprecated. use tell() instead. |
int |
getLength()
Deprecated. use length() instead. |
long |
length()
Get the current length of the stream. |
boolean |
seek(int pos)
Deprecated. use seek(long pos) instead. |
void |
seek(long position)
Set the stream position. |
void |
setLength(long newLength)
Set the length of the RandomAccessStream if possible. |
long |
tell()
Get the current stream position. |
RandomStream |
toRandomStream()
|
| Methods inherited from interface ewe.io.BasicRandomAccessStream |
canWrite, getStreamLength, nonBlockingRead, nonBlockingWrite, seekPosition, setStreamLength, tellPosition |
| Methods inherited from interface ewe.io.BasicStream |
close, closeStream, flushStream, isOpen, nonBlockingRead, nonBlockingWrite |
| Methods inherited from interface ewe.io.Stream |
flush, read, read, read, readBytes, readBytes, toInputStream, toOutputStream, write, write, write, writeBytes, writeBytes |
| Method Detail |
public int getLength()
public boolean seek(int pos)
pos - The new file position to set.
public int getFilePosition()
public void seek(long position)
throws IOException
position - The position to seek to.
IOException - if an error occurs while seeking.
public long tell()
throws IOException
IOException - if an error occurs.
public long length()
throws IOException
IOException - if an error occurs.
public void setLength(long newLength)
throws IOException
Make no assumptions about the success of this method. Not all RAS objects will support setStreamLength() or setLength() - not even all Files on all systems will support this. For example, PersonalJava/Java 1.1 does not support this feature and will throw an IOException.
What happens to the file position pointer after this method is called is unpredictable, especially if you are truncating the file. You should ALWAYS reset the file position pointer after calling this method to be where you wish it to be.
IOExceptionpublic RandomStream toRandomStream()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||