public class FSDataInputStream extends DataInputStream implements Seekable, PositionedReadable, Closeable, HasFileDescriptor
FSInputStream in a DataInputStream
and buffers input through a BufferedInputStream.in| 构造器和说明 |
|---|
FSDataInputStream(InputStream in) |
| 限定符和类型 | 方法和说明 |
|---|---|
FileDescriptor |
getFileDescriptor() |
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, skipBytesavailable, close, mark, markSupported, read, reset, skippublic FSDataInputStream(InputStream in) throws IOException
IOExceptionpublic void seek(long desired)
throws IOException
Seekableseek 在接口中 SeekableIOExceptionpublic long getPos()
throws IOException
SeekablegetPos 在接口中 SeekableIOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
PositionedReadableread 在接口中 PositionedReadableIOExceptionpublic void readFully(long position,
byte[] buffer,
int offset,
int length)
throws IOException
PositionedReadablereadFully 在接口中 PositionedReadableIOExceptionpublic void readFully(long position,
byte[] buffer)
throws IOException
PositionedReadablereadFully 在接口中 PositionedReadableIOExceptionpublic boolean seekToNewSource(long targetPos)
throws IOException
SeekableseekToNewSource 在接口中 SeekableIOExceptionpublic FileDescriptor getFileDescriptor() throws IOException
getFileDescriptor 在接口中 HasFileDescriptorIOExceptionCopyright © 2009 The Apache Software Foundation