Package org.jruby.util.io
Class SeekableByteChannelImpl
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
org.jruby.util.io.SeekableByteChannelImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,InterruptibleChannel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel
final class SeekableByteChannelImpl
extends AbstractInterruptibleChannel
implements ReadableByteChannel, SeekableByteChannel
Seekable byte channel impl over a byte array stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate static final Fieldprivate final ByteArrayInputStreamprivate final intprivate static final Fieldprivate static final Fieldprivate int(package private) static final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static FieldaccessibleField(String name) private static intprotected voidprivate static intprivate static intlongposition()position(long newPosition) intread(ByteBuffer target) private static intreadIntField(ByteArrayInputStream self, Field field) longsize()truncate(long size) intwrite(ByteBuffer src) Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
in
-
mark
private final int mark -
count
private final int count -
truncatedBy
private int truncatedBy -
USABLE
static final boolean USABLE -
posField
-
countField
-
markField
-
-
Constructor Details
-
SeekableByteChannelImpl
SeekableByteChannelImpl(ByteArrayInputStream in)
-
-
Method Details
-
read
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Throws:
IOException
-
implCloseChannel
- Specified by:
implCloseChannelin classAbstractInterruptibleChannel- Throws:
IOException
-
position
public long position()- Specified by:
positionin interfaceSeekableByteChannel
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
size
public long size()- Specified by:
sizein interfaceSeekableByteChannel
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
pos
-
count
-
mark
-
readIntField
-
accessibleField
-