|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Method Summary | |
boolean |
canWrite()
Tests if the RandomAccessStream was opened in read-write mode as opposed to read-ony mode. |
long |
getStreamLength()
Gets the length of the open stream. |
int |
nonBlockingRead(long location,
byte[] dest,
int offset,
int length)
Non-blocking read at a particular location. |
int |
nonBlockingWrite(long location,
byte[] src,
int offset,
int length)
Non-blocking write at a particular location. |
boolean |
seekPosition(long pos)
Tell the Stream to move to the specific position. |
boolean |
setStreamLength(long newLength)
Set the length of the RandomAccessStream if possible. |
long |
tellPosition()
Retrieve the file position. |
| Methods inherited from interface ewe.io.BasicStream |
close, closeStream, flushStream, isOpen, nonBlockingRead, nonBlockingWrite |
| Method Detail |
public boolean seekPosition(long pos)
throws IOException
pos - The position to seek to.
IOException - if an error occured during the seek.
public long tellPosition()
throws IOException
IOException - if an error occured while getting the position.
public long getStreamLength()
throws IOException
IOException - if an error occured while getting the length.
public boolean setStreamLength(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.
IOException
public int nonBlockingRead(long location,
byte[] dest,
int offset,
int length)
throws IOException
location - The location to read from.dest - The destination buffer.offset - The location in the buffer to hold the data.length - The number of bytes to read.
IOException - if an error occured during reading.
public int nonBlockingWrite(long location,
byte[] src,
int offset,
int length)
throws IOException
location - The location to write to.src - The source buffer.offset - The location in the buffer that holds the data.length - The number of bytes to write.
IOException - if an error occured during writing.public boolean canWrite()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||