Package com.martiansoftware.nailgun
Class NGInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.martiansoftware.nailgun.NGInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
class NGInputStream extends java.io.FilterInputStreamA FilterInputStream that is able to read the chunked stdin stream from a NailGun client.
-
-
Constructor Summary
Constructors Constructor Description NGInputStream(java.io.InputStream in, java.io.DataOutputStream out)Creates a new NGInputStream wrapping the specified InputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int offset, int length)private voidreadHeader()Reads a NailGun chunk header from the underlying InputStream.
-
-
-
Constructor Detail
-
NGInputStream
public NGInputStream(java.io.InputStream in, java.io.DataOutputStream out)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 Detail
-
readHeader
private void readHeader() throws java.io.IOExceptionReads a NailGun chunk header from the underlying InputStream.- Throws:
java.io.IOException- if thrown by the underlying InputStream, or if an unexpected NailGun chunk type is encountered.
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.FilterInputStream- Throws:
java.io.IOException- See Also:
InputStream.available()
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.FilterInputStream- See Also:
InputStream.markSupported()
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException- See Also:
InputStream.read()
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int offset, int length) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
-