|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ReadWriteDevice
Interface for defining stream oriented read/write devices.
Nested Class Summary | |
---|---|
static class |
ReadWriteDevice.RWDInputStream
Implementation of an InputStream wrapped around a ReadWriteDevice. |
static class |
ReadWriteDevice.RWDOutputStream
Implementation of an OutputStream wrapped around a ReadWriteDevice. |
Method Summary | |
---|---|
int |
available()
Returns the number of bytes between the current pointer and end-of-stream. |
void |
close()
Closes the device. |
void |
flush()
Flushes the device. |
java.io.InputStream |
getInputStream()
Return an InputStream for reading from this device. |
java.io.OutputStream |
getOutputStream()
Return an OututStream for writing to this device. |
long |
getPointer()
Returns the current pointer for this device. |
long |
length()
Returns the total length in bytes of this device. |
void |
mark(long markLimit)
Sets the mark with the specified limit. |
boolean |
markSupported()
Returns whether mark is supported. |
int |
read()
Reads and returns a single byte. |
int |
read(byte[] b)
Reads up to b.length bytes from the device into array b. |
int |
read(byte[] b,
int offset,
int len)
Reads up to len bytes from the device into array b at b[offset]. |
void |
reset()
Resets the pointer to the mark position. |
void |
seek(long newPointer)
Seeks the pointer to the specified offset. |
long |
skip(long amtToSkip)
Advances the pointer by the specified number of bytes |
void |
write(byte[] b)
Writes b.length bytes from array b to the device. |
void |
write(byte[] b,
int offset,
int len)
Writes len bytes from array b starting at b[offset] to the device. |
void |
write(int b)
Writes a single byte to the device. |
Method Detail |
---|
void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
void flush() throws java.io.IOException
java.io.IOException
int available() throws java.io.IOException
java.io.IOException
long length() throws java.io.IOException
java.io.IOException
long getPointer() throws java.io.IOException
java.io.IOException
void seek(long newPointer) throws java.io.IOException
java.io.IOException
long skip(long amtToSkip) throws java.io.IOException
java.io.IOException
int read() throws java.io.IOException
java.io.IOException
int read(byte[] b) throws java.io.IOException
java.io.IOException
int read(byte[] b, int offset, int len) throws java.io.IOException
java.io.IOException
void write(int b) throws java.io.IOException
java.io.IOException
void write(byte[] b) throws java.io.IOException
java.io.IOException
void write(byte[] b, int offset, int len) throws java.io.IOException
java.io.IOException
void mark(long markLimit) throws java.io.IOException
java.io.IOException
boolean markSupported()
void reset() throws java.io.IOException
java.io.IOException
java.io.InputStream getInputStream()
java.io.OutputStream getOutputStream()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |