|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.io.RandomStream
| Field Summary | |
protected boolean |
closed
|
protected boolean |
noWritingAllowed
Set this true if you are implementing a read-only RandomStream. |
protected RandomAccessStream |
ras
|
| Constructor Summary | |
protected |
RandomStream()
|
|
RandomStream(RandomAccessStream ras)
|
| Method Summary | |
int |
available()
|
protected void |
cantWrite()
Calling this method causes an IOException to be thrown indicating that writing to this RandomStream is not possible. |
boolean |
canWrite()
|
protected void |
checkClosed()
|
void |
close()
|
void |
flush()
|
FastStream |
getFastStream()
If the underlying Stream object implements FastStream this method will return that Stream object. |
long |
length()
|
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] buffer)
Read in a number of bytes of data from the input stream equal to the length of the provided buffer. |
int |
read(byte[] buffer,
int start,
int length)
Read in a number of bytes of data from the input stream. |
protected int |
readSingleByteFromMultiByteRead()
This reads a single byte using the InputStream read(byte[] buffer,int start,int lengh) method. |
void |
seek(long position)
|
void |
setLength(long newLength)
|
void |
shutdown()
Shutdown the stream but do not close any underlying IO stream. |
long |
skip(long toSkip)
|
long |
tell()
|
InputStream |
toInputStream()
|
OutputStream |
toOutputStream()
|
RandomAccessStream |
toRandomAccessStream()
|
Stream |
toReadableStream()
|
Stream |
toWritableStream()
|
void |
write(byte[] buffer)
Write a number of bytes of data to the output stream equal to the length of the provided buffer. |
void |
write(byte[] buffer,
int start,
int length)
Write a number of bytes of data to the output stream. |
void |
write(int value)
Writes a single byte to the stream. |
protected void |
writeSingleByteToMultiByteWrite(int value)
This writes a single byte using the OutputStream write(byte[] buffer,int start,int lengh) method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
protected RandomAccessStream ras
protected boolean closed
protected boolean noWritingAllowed
| Constructor Detail |
public RandomStream(RandomAccessStream ras)
protected RandomStream()
| Method Detail |
protected void cantWrite()
throws IOException
IOException - always thrown.
protected void checkClosed()
throws IOException
IOException
public void close()
throws IOException
IOException
public void seek(long position)
throws IOException
IOException
public long tell()
throws IOException
IOException
public long length()
throws IOException
IOException
public void setLength(long newLength)
throws IOException
IOException
protected int readSingleByteFromMultiByteRead()
throws IOException
IOException
public int read()
throws IOException
IOException - if an I/O error occured.
public int read(byte[] buffer,
int start,
int length)
throws IOException
buffer - a destination buffer for the data.start - The start offset in the destination buffer.length - The number of bytes to read.
IOException - if an I/O error occurs during reading.
public int read(byte[] buffer)
throws IOException
buffer - a destination buffer for the data.
IOException - if an I/O error occurs during reading.
public void flush()
throws IOException
IOException
public void write(int value)
throws IOException
IOException - if an I/O error occured.
public void write(byte[] buffer,
int start,
int length)
throws IOException
buffer - the source buffer for the data.start - The start offset in the buffer.length - The number of bytes to write.
IOException - if an I/O error occurs during writing.
public void write(byte[] buffer)
throws IOException
buffer - the source buffer for the data.
IOException - if an I/O error occurs during writing.
public void shutdown()
throws IOException
IOException - on error.
protected void writeSingleByteToMultiByteWrite(int value)
throws IOException
IOException
public int available()
throws IOException
IOException
public long skip(long toSkip)
throws IOException
IOExceptionpublic boolean canWrite()
public Stream toReadableStream()
public Stream toWritableStream()
public RandomAccessStream toRandomAccessStream()
public InputStream toInputStream()
public OutputStream toOutputStream()
public FastStream getFastStream()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||