public class AlluxioHdfsInputStream extends FileInStream
Constructor and Description |
---|
AlluxioHdfsInputStream(org.apache.hadoop.fs.FSDataInputStream input) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
long |
getPos() |
void |
mark(int limit) |
boolean |
markSupported() |
int |
positionedRead(long position,
byte[] buffer,
int offset,
int length)
Reads up to the specified number of bytes, from a given position within a file, and return the
number of bytes read.
|
int |
read() |
int |
read(byte[] bytes) |
int |
read(byte[] bytes,
int offset,
int length) |
int |
read(ByteBuffer buf)
Reads up to buf.remaining() bytes into buf.
|
long |
remaining() |
void |
reset() |
void |
seek(long position)
Moves the starting read position of the stream to the specified position which is relative to
the start of the stream.
|
long |
skip(long length) |
read
public AlluxioHdfsInputStream(org.apache.hadoop.fs.FSDataInputStream input)
input
- Hadoop FileSystem FSDataInputStreampublic int read(byte[] bytes) throws IOException
read
in class FileInStream
IOException
public int read(byte[] bytes, int offset, int length) throws IOException
read
in class FileInStream
IOException
public int read() throws IOException
read
in class FileInStream
IOException
public int read(ByteBuffer buf) throws IOException
FileInStream
After a successful call, buf.position() will be advanced by the number of bytes read and buf.limit() should be unchanged.
In the case of an exception, the values of buf.position() and buf.limit() are undefined, and callers should be prepared to recover from this eventually.
Implementations should treat 0-length requests as legitimate, and must not signal an error upon their receipt.
read
in class FileInStream
buf
- the ByteBuffer to receive the results of the read operationIOException
public long skip(long length) throws IOException
skip
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public void mark(int limit)
mark
in class InputStream
public void reset() throws IOException
reset
in class InputStream
IOException
public boolean markSupported()
markSupported
in class InputStream
public void seek(long position) throws IOException
Seekable
position
- the position to seek to, it must be between 0 and the end of the stream - 1IOException
public long getPos() throws IOException
IOException
public long remaining()
public int positionedRead(long position, byte[] buffer, int offset, int length) throws IOException
PositionedReadable
position
- position within filebuffer
- destination bufferoffset
- offset in the bufferlength
- number of bytes to readIOException
Copyright © 2023. All Rights Reserved.