public class FSDataInputStream extends DataInputStream implements Seekable, PositionedReadable
FSInputStream
in a DataInputStream
and buffers input through a BufferedInputStream
.in
Constructor and Description |
---|
FSDataInputStream(InputStream in) |
Modifier and Type | Method and Description |
---|---|
long |
getPos()
Return the current offset from the start of the file
|
int |
read(long position,
byte[] buffer,
int offset,
int length)
Read upto the specified number of bytes, from a given
position within a file, and return the number of bytes read.
|
void |
readFully(long position,
byte[] buffer)
Read number of bytes equalt to the length of the buffer, from a given
position within a file.
|
void |
readFully(long position,
byte[] buffer,
int offset,
int length)
Read the specified number of bytes, from a given
position within a file.
|
void |
seek(long desired)
Seek to the given offset from the start of the file.
|
boolean |
seekToNewSource(long targetPos)
Seeks a different copy of the data.
|
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
available, close, mark, markSupported, read, reset, skip
public FSDataInputStream(InputStream in) throws IOException
IOException
public void seek(long desired) throws IOException
Seekable
seek
in interface Seekable
IOException
public long getPos() throws IOException
Seekable
getPos
in interface Seekable
IOException
public int read(long position, byte[] buffer, int offset, int length) throws IOException
PositionedReadable
read
in interface PositionedReadable
IOException
public void readFully(long position, byte[] buffer, int offset, int length) throws IOException
PositionedReadable
readFully
in interface PositionedReadable
IOException
public void readFully(long position, byte[] buffer) throws IOException
PositionedReadable
readFully
in interface PositionedReadable
IOException
public boolean seekToNewSource(long targetPos) throws IOException
Seekable
seekToNewSource
in interface Seekable
IOException
Copyright © 2010 The Apache Software Foundation