public class BufferedFSInputStream extends BufferedInputStream implements Seekable, PositionedReadable, HasFileDescriptor
in
构造器和说明 |
---|
BufferedFSInputStream(FSInputStream in,
int size)
Creates a
BufferedFSInputStream
with the specified buffer size,
and saves its argument, the input stream
in , for later use. |
限定符和类型 | 方法和说明 |
---|---|
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 pos)
Seek to the given offset from the start of the file.
|
boolean |
seekToNewSource(long targetPos)
Seeks a different copy of the data.
|
long |
skip(long n) |
available, close, mark, markSupported, read, read, reset
read
public BufferedFSInputStream(FSInputStream in, int size)
BufferedFSInputStream
with the specified buffer size,
and saves its argument, the input stream
in
, for later use. An internal
buffer array of length size
is created and stored in buf
.in
- the underlying input stream.size
- the buffer size.IllegalArgumentException
- if size <= 0.public long getPos() throws IOException
Seekable
getPos
在接口中 Seekable
IOException
public long skip(long n) throws IOException
skip
在类中 BufferedInputStream
IOException
public void seek(long pos) throws IOException
Seekable
seek
在接口中 Seekable
IOException
public boolean seekToNewSource(long targetPos) throws IOException
Seekable
seekToNewSource
在接口中 Seekable
IOException
public int read(long position, byte[] buffer, int offset, int length) throws IOException
PositionedReadable
read
在接口中 PositionedReadable
IOException
public void readFully(long position, byte[] buffer, int offset, int length) throws IOException
PositionedReadable
readFully
在接口中 PositionedReadable
IOException
public void readFully(long position, byte[] buffer) throws IOException
PositionedReadable
readFully
在接口中 PositionedReadable
IOException
public FileDescriptor getFileDescriptor() throws IOException
getFileDescriptor
在接口中 HasFileDescriptor
IOException
Copyright © 2009 The Apache Software Foundation