public class SubstreamInputStream extends InputStream
Constructor and Description |
---|
SubstreamInputStream(InputStream inputStream,
int length) |
Modifier and Type | Method and Description |
---|---|
void |
close()
For a SubstreamInputStream we of course don't want to close the outer stream when this stream is closed, as
there's more of the outer stream that follows this one.
|
int |
read()
Reads a single byte from this stream and returns it as an integer in the range from 0 to 255.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads at most
length bytes from this stream and stores them in the byte array b starting at
offset . |
copyTo, copyToByteArray, finalize, read, readFully, readFully
public SubstreamInputStream(InputStream inputStream, int length)
public void close()
close
in interface java.lang.AutoCloseable
close
in class InputStream
public int read()
InputStream
read
in class InputStream
public int read(byte[] buffer, int offset, int length)
InputStream
length
bytes from this stream and stores them in the byte array b
starting at
offset
.read
in class InputStream
buffer
- the byte array in which to store the bytes readoffset
- the initial position in buffer
to store the bytes read from this streamlength
- the maximum number of bytes to store in b