class NGInputStream
extends java.io.FilterInputStream
| Modifier and Type | Field and Description |
|---|---|
private java.io.DataInputStream |
din |
private boolean |
eof |
private byte[] |
oneByteBuffer |
private java.io.DataOutputStream |
out |
private long |
remaining |
private boolean |
started |
| Constructor and Description |
|---|
NGInputStream(java.io.InputStream in,
java.io.DataOutputStream out)
Creates a new NGInputStream wrapping the specified InputStream
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int offset,
int length) |
private void |
readHeader()
Reads a NailGun chunk header from the underlying InputStream.
|
private java.io.DataInputStream din
private boolean eof
private long remaining
private byte[] oneByteBuffer
private final java.io.DataOutputStream out
private boolean started
public NGInputStream(java.io.InputStream in,
java.io.DataOutputStream out)
in - the InputStream to wrapout - the OutputStream to which a STARTINPUT chunk should
be sent prior to the first read.private void readHeader()
throws java.io.IOException
java.io.IOException - if thrown by the underlying InputStream,
or if an unexpected NailGun chunk type is encountered.public int available()
throws java.io.IOException
available in class java.io.FilterInputStreamjava.io.IOExceptionInputStream.available()public boolean markSupported()
markSupported in class java.io.FilterInputStreamInputStream.markSupported()public int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionInputStream.read()public int read(byte[] b)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionjava.io.InputStream.read(byte[])public int read(byte[] b,
int offset,
int length)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionjava.io.InputStream.read(byte[],offset,length)