Package com.jalios.io
Class NIOBufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.jalios.io.NIOBufferInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NIOBufferInputStream extends java.io.InputStreamThis class wraps an InputStream around a java.nio.ByteBuffer.- Since:
- jcms-5.0.0
- Author:
- Olivier Dedieu
-
-
Constructor Summary
Constructors Constructor Description NIOBufferInputStream(java.nio.ByteBuffer buffer)Construct a NIOBufferInputStream with the given bufferNIOBufferInputStream(java.nio.ByteBuffer buffer, java.nio.channels.Channel channel)Construct a NIOBufferInputStream with the given buffer and the given channel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readlimit)booleanmarkSupported()mark is *not* supported.intread()
-
-
-
Constructor Detail
-
NIOBufferInputStream
public NIOBufferInputStream(java.nio.ByteBuffer buffer)
Construct a NIOBufferInputStream with the given buffer- Parameters:
buffer- the buffer to be wrapped- Since:
- jcms-5.0.0
-
NIOBufferInputStream
public NIOBufferInputStream(java.nio.ByteBuffer buffer, java.nio.channels.Channel channel)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 Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.InputStream
-
markSupported
public boolean markSupported()
mark is *not* supported.- Overrides:
markSupportedin classjava.io.InputStream
-
-