Package cn.sliew.milky.common.io.stream
Class InputStreamStreamInput
- java.lang.Object
-
- java.io.InputStream
-
- cn.sliew.milky.common.io.stream.StreamInput
-
- cn.sliew.milky.common.io.stream.InputStreamStreamInput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class InputStreamStreamInput extends StreamInput
-
-
Constructor Summary
Constructors Constructor Description InputStreamStreamInput(InputStream is)Creates a new InputStreamStreamInput with unlimited size
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()Closes the stream to further operations.intread()bytereadByte()Reads and returns a single byte.voidreadBytes(byte[] b, int offset, int len)Reads a specified number of bytes into an array at the specified offset.-
Methods inherited from class cn.sliew.milky.common.io.stream.StreamInput
readBoolean, readDouble, readFloat, readGenericValue, readInt, readLong, readOptionalBoolean, readOptionalDouble, readOptionalFloat, readOptionalInt, readOptionalLong, readOptionalVInt, readOptionalVLong, readShort, readVInt, readVLong, readZLong, wrap, wrap
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
InputStreamStreamInput
public InputStreamStreamInput(InputStream is)
Creates a new InputStreamStreamInput with unlimited size- Parameters:
is- the input stream to wrap
-
-
Method Detail
-
close
public void close() throws IOExceptionDescription copied from class:StreamInputCloses the stream to further operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classStreamInput- Throws:
IOException
-
available
public int available() throws IOException- Specified by:
availablein classStreamInput- Throws:
IOException
-
readByte
public byte readByte() throws IOExceptionDescription copied from class:StreamInputReads and returns a single byte.- Specified by:
readBytein classStreamInput- Throws:
IOException
-
readBytes
public void readBytes(byte[] b, int offset, int len) throws IOExceptionDescription copied from class:StreamInputReads a specified number of bytes into an array at the specified offset.- Specified by:
readBytesin classStreamInput- Parameters:
b- the array to read bytes intooffset- the offset in the array to start storing byteslen- the number of bytes to read- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
-