public class JSimpleInputStreamOnJavaStream extends InputStream
Constructor and Description |
---|
JSimpleInputStreamOnJavaStream(java.io.InputStream javaInputStream) |
JSimpleInputStreamOnJavaStream(java.io.InputStream javaInputStream,
boolean ignoreClose)
Create a JSimple stream that wraps the specified Java InputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this stream.
|
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)
Reads bytes from this stream and stores them in the byte array
b . |
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, readFully, readFully
public JSimpleInputStreamOnJavaStream(java.io.InputStream javaInputStream)
public JSimpleInputStreamOnJavaStream(java.io.InputStream javaInputStream, boolean ignoreClose)
javaInputStream
- Java InputStreamignoreClose
- whether or not to close the underlying stream when this stream is closedpublic int read()
InputStream
read
in class InputStream
public int read(byte[] buffer)
InputStream
b
.read
in class InputStream
buffer
- the byte array in which to store the bytes readpublic 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
public void close()
InputStream
close
in interface java.lang.AutoCloseable
close
in class InputStream