Package opendap.dap
Class HeaderInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- opendap.dap.HeaderInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HeaderInputStream extends FilterInputStream
The HeaderInputStream filters the input to only read lines of text until the "Data:" line. This is required because overzealous buffering in the DDSParser will read the data as well as the DDS otherwise.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description HeaderInputStream(InputStream in)Construct a new HeaderInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()Return the number of bytes in the buffer.booleanmarkSupported()Returns that we don't support the mark() and reset() methods.intread()Reads a single byte of dataintread(byte[] b, int off, int len)Reads up to len bytes of data from this input stream into an array of bytes.longskip(long n)Skips over and discards n bytes of data from the input stream.-
Methods inherited from class java.io.FilterInputStream
close, mark, read, reset
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
HeaderInputStream
public HeaderInputStream(InputStream in)
Construct a new HeaderInputStream.
-
-
Method Detail
-
available
public int available()
Return the number of bytes in the buffer.- Overrides:
availablein classFilterInputStream
-
markSupported
public boolean markSupported()
Returns that we don't support the mark() and reset() methods.- Overrides:
markSupportedin classFilterInputStream
-
read
public int read() throws IOExceptionReads a single byte of data- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOExceptionReads up to len bytes of data from this input stream into an array of bytes. This method blocks until some input is available.- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
public long skip(long n)
Skips over and discards n bytes of data from the input stream.- Overrides:
skipin classFilterInputStream
-
-