Package net.sansa_stack.hadoop.util
Class SeekableByteChannelFromSeekableInputStream
- java.lang.Object
-
- net.sansa_stack.nio.util.ReadableByteChannelFromInputStream
-
- net.sansa_stack.hadoop.util.SeekableByteChannelFromSeekableInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,ReadableByteChannel
,SeekableByteChannel
,WritableByteChannel
public class SeekableByteChannelFromSeekableInputStream extends ReadableByteChannelFromInputStream implements SeekableByteChannel
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.hadoop.fs.Seekable
seekable
-
Fields inherited from class net.sansa_stack.nio.util.ReadableByteChannelFromInputStream
buf, in, open
-
-
Constructor Summary
Constructors Constructor Description SeekableByteChannelFromSeekableInputStream(InputStream in)
SeekableByteChannelFromSeekableInputStream(InputStream in, org.apache.hadoop.fs.Seekable seekable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isOpen()
long
position()
SeekableByteChannel
position(long newPosition)
long
size()
SeekableByteChannel
truncate(long size)
int
write(ByteBuffer src)
-
Methods inherited from class net.sansa_stack.nio.util.ReadableByteChannelFromInputStream
close, read
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.nio.channels.SeekableByteChannel
read
-
-
-
-
Constructor Detail
-
SeekableByteChannelFromSeekableInputStream
public SeekableByteChannelFromSeekableInputStream(InputStream in)
-
SeekableByteChannelFromSeekableInputStream
public SeekableByteChannelFromSeekableInputStream(InputStream in, org.apache.hadoop.fs.Seekable seekable)
-
-
Method Detail
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
write
in interfaceSeekableByteChannel
- Specified by:
write
in interfaceWritableByteChannel
- Throws:
IOException
-
position
public long position() throws IOException
- Specified by:
position
in interfaceSeekableByteChannel
- Throws:
IOException
-
position
public SeekableByteChannel position(long newPosition) throws IOException
- Specified by:
position
in interfaceSeekableByteChannel
- Throws:
IOException
-
size
public long size() throws IOException
- Specified by:
size
in interfaceSeekableByteChannel
- Throws:
IOException
-
truncate
public SeekableByteChannel truncate(long size) throws IOException
- Specified by:
truncate
in interfaceSeekableByteChannel
- Throws:
IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfaceChannel
- Overrides:
isOpen
in classReadableByteChannelFromInputStream
-
-