Package com.martiansoftware.nailgun
Class NGInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.martiansoftware.nailgun.NGInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A FilterInputStream that is able to read the chunked stdin stream
from a NailGun client.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataInputStream
private boolean
private byte[]
private final DataOutputStream
private long
private boolean
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionNGInputStream
(InputStream in, DataOutputStream out) Creates a new NGInputStream wrapping the specified InputStream -
Method Summary
Methods inherited from class java.io.FilterInputStream
close, mark, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
din
-
eof
private boolean eof -
remaining
private long remaining -
oneByteBuffer
private byte[] oneByteBuffer -
out
-
started
private boolean started
-
-
Constructor Details
-
NGInputStream
Creates a new NGInputStream wrapping the specified InputStream- Parameters:
in
- the InputStream to wrapout
- the OutputStream to which a STARTINPUT chunk should be sent prior to the first read.
-
-
Method Details
-
readHeader
Reads a NailGun chunk header from the underlying InputStream.- Throws:
IOException
- if thrown by the underlying InputStream, or if an unexpected NailGun chunk type is encountered.
-
available
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
- See Also:
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classFilterInputStream
- See Also:
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
- See Also:
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-