| ?????? |
|---|
StreamInput(InputStream inputStream,
int bufferSize)
Constructs a
StreamInput. |
| ?????? | ????? |
|---|---|
int |
available()
Overrides the
Input.available(). |
void |
close()
Overrides the
Input.seek(long). |
int |
read(ByteBuffer dst)
Overrides the
Input.read(ByteBuffer). |
int |
read(long position,
byte[] buffer,
int offset,
int length)
Overrides the
Input.read(long, byte[], int, int)
. |
void |
seek(long position)
Overrides the
Input.seek(long). |
long |
skip(long n)
Overrides the
Input.skip(long). |
public StreamInput(InputStream inputStream, int bufferSize)
StreamInput.inputStream - the inputstream object.bufferSize - the buffersize.public int read(ByteBuffer dst) throws IOException
Input.read(ByteBuffer).
Reads a sequence of bytes from input into the given buffer.read ???? Inputdst - The buffer into which bytes are to be transferred.-1 if there is no more data because the end of the
stream has been reached.IOException - if an I/O error occurs.public long skip(long n)
throws IOException
Input.skip(long). Skips
over and discards n bytes of data from this input stream.skip ???? Inputn - the number of bytes to be skipped.IOException - if an I/O error occurs.public int available()
throws IOException
Input.available(). Returns an estimate of the
number of bytes that can be read (or skipped over) from this input stream
without blocking by the next invocation of a method for this input
stream. The next invocation might be the same thread or another thread. A
single read or skip of this many bytes will not block, but may read or
skip fewer bytes.available ???? Input0 when
it reaches the end of the input stream.IOException - if an I/O error occurs.public int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
Input.read(long, byte[], int, int)
. Reads up to len bytes of data from the input stream into
an array of bytes. An attempt is made to read as many as len
bytes, but a smaller number may be read. The number of bytes actually
read is returned as an integer.read ???? Inputposition - the given position within a stream.buffer - the buffer into which the data is read.offset - the start offset in array buffer.length - the maximum number of bytes to read.-1 if there is no more data because the end of the
stream has been reached.IOException - if an I/O error occurs.public void seek(long position)
throws IOException
Input.seek(long). Seeks to
the given offset from the start of the stream. The next read() will be
from that location.seek ???? Inputposition - the offset from the start of the stream.IOException - if an I/O error occurs.public void close()
throws IOException
Input.seek(long). Closes
this input and releases any system resources associated with the under
layer input.close ???? InputIOException - if an I/O error occurs.Copyright © 2016 The Apache Software Foundation. All rights reserved.