Class ReadableByteChannelAdapter<T extends ReadableChannel<byte[]>>
java.lang.Object
org.aksw.commons.io.input.ReadableByteChannelAdapter<T>
- All Implemented Interfaces:
Closeable, AutoCloseable, Channel, ReadableByteChannel
- Direct Known Subclasses:
SeekableByteChannelAdapter
public class ReadableByteChannelAdapter<T extends ReadableChannel<byte[]>>
extends Object
implements ReadableByteChannel
Wrapper to treat a DataStreaminvalid input: '<'byte[]> as a
ReadableByteChannel.
Use with Channels.newInputStream(ReadableByteChannel) to obtain
a conventional InputStream over a a ReadableChannel.- Author:
- raven
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]Buffer is only initialized when non-array-backed ByteBuffer are passed toread(ByteBuffer).protected Tprotected final int -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
delegate
-
buf
protected byte[] bufBuffer is only initialized when non-array-backed ByteBuffer are passed toread(ByteBuffer). -
transferSize
protected final int transferSize- See Also:
-
-
Constructor Details
-
ReadableByteChannelAdapter
-
-
Method Details
-
getDelegate
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isOpen
-
read
- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-