|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
com.voytechs.jnetstream.io.StackInputStream
public class StackInputStream
| Field Summary | |
|---|---|
protected byte[] |
buf
This is where we cache data read from the stream after the first push() method has been called. |
protected int |
count
Keep track of current positions and sizes in our buffer. |
protected java.util.Stack |
markers
|
protected int |
offset
|
protected java.util.Stack |
positions
A stack which contains the pushed byte arrays. |
| Constructor Summary | |
|---|---|
StackInputStream(java.io.InputStream inputStream)
|
|
StackInputStream(java.io.InputStream inputStream,
int bufSize)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears the last entry on the stack without rewinding to the position on the entry being cleared. |
static java.lang.String |
hex(int b)
|
static void |
main(java.lang.String[] args)
Test function for StackInputStream |
long |
position()
Returns the exact offset within the over-all stream starting at 0. |
static void |
printStream(java.io.InputStream in,
int count)
|
int |
read()
read next byte from our source inputStream. |
void |
reset()
Resets the current stack buffer to initial states. |
long |
skip(long n)
Skips N bytes of data in the stream and advances the position. |
| Methods inherited from class java.io.InputStream |
|---|
available, close, mark, markSupported, read, read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Stack positions
protected java.util.Stack markers
protected int count
protected int offset
protected byte[] buf
| Constructor Detail |
|---|
public StackInputStream(java.io.InputStream inputStream)
inputStream -
public StackInputStream(java.io.InputStream inputStream,
int bufSize)
| Method Detail |
|---|
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamn - Number of bytes to skip from this stream.
java.io.IOException
public void clear()
throws java.io.IOException
java.io.IOException
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException - any IO condition reported by source input stream.public void reset()
reset in class java.io.InputStreampublic long position()
public static void main(java.lang.String[] args)
args - command line arguments
public static void printStream(java.io.InputStream in,
int count)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String hex(int b)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||