|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
org.blinkenbyte.io.ReadWriteDevice.RWDInputStream
public static class ReadWriteDevice.RWDInputStream
Implementation of an InputStream wrapped around a ReadWriteDevice.
| Field Summary | |
|---|---|
protected boolean |
isClosed
Flag indicating if this stream has been closed. |
ReadWriteDevice |
rwd
The ReadWriteDevice being wrapped. |
| Constructor Summary | |
|---|---|
ReadWriteDevice.RWDInputStream(ReadWriteDevice _rwd)
Constructs a new RWDInputStream from a ReadWriteDevice. |
|
| Method Summary | |
|---|---|
int |
available()
Returns the number of bytes available to be read without blocking. |
void |
close()
Closes this stream (but not the underlying ReadWriteDevice). |
void |
mark(int readLimit)
Marks the input stream. |
boolean |
markSupported()
Returns whether the ReadWriteDevice being wrapped supports mark. |
int |
read()
Reads a byte from the underlying ReadWriteDevice. |
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 stream to the mark. |
long |
skip(long n)
Skips n bytes from the stream. |
protected void |
throwIfClosed()
Convenience method to throw an exception if the stream has been closed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public ReadWriteDevice rwd
protected boolean isClosed
| Constructor Detail |
|---|
public ReadWriteDevice.RWDInputStream(ReadWriteDevice _rwd)
| Method Detail |
|---|
protected void throwIfClosed()
throws java.io.IOException
java.io.IOException
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readLimit)
mark in class java.io.InputStreampublic boolean markSupported()
markSupported in class java.io.InputStream
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b,
int offset,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOException
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||