Package com.jalios.io
Class NIOBufferInputStream
java.lang.Object
java.io.InputStream
com.jalios.io.NIOBufferInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
This class wraps an InputStream around a java.nio.ByteBuffer.
- Since:
- jcms-5.0.0
- Author:
- Olivier Dedieu
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNIOBufferInputStream(ByteBuffer buffer) Construct a NIOBufferInputStream with the given bufferNIOBufferInputStream(ByteBuffer buffer, Channel channel) Construct a NIOBufferInputStream with the given buffer and the given channel. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
buffer
-
channel
-
-
Constructor Details
-
NIOBufferInputStream
Construct a NIOBufferInputStream with the given buffer- Parameters:
buffer- the buffer to be wrapped- Since:
- jcms-5.0.0
-
NIOBufferInputStream
Construct a NIOBufferInputStream with the given buffer and the given channel. The channel is closed when the InputStream is closed.- Parameters:
buffer- the buffer to be wrappedchannel- the channel the buffer is associated to.- Since:
- jcms-5.0.0
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()mark is *not* supported.- Overrides:
markSupportedin classInputStream
-