public class ByteArraySeekableStream extends SeekableInputStream
| 构造器和说明 |
|---|
ByteArraySeekableStream(byte[] buf) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
available() |
void |
close()
Closes this input stream and releases any system resources associated with the stream.
|
long |
getPos()
Gets the current position in the input stream.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from the input stream into an array of bytes. |
void |
reset() |
void |
seek(long desired)
Seek to the given offset from the start of the file.
|
long |
skip(long n) |
public void seek(long desired)
throws IOException
SeekableInputStreamseek 在类中 SeekableInputStreamdesired - the desired offsetIOException - Thrown if an error occurred while seeking inside the input stream.public long getPos()
throws IOException
SeekableInputStreamgetPos 在类中 SeekableInputStreamIOException - Thrown if an I/O error occurred in the underlying stream implementation
while accessing the stream's position.public int read()
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
SeekableInputStreamlen 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 在类中 SeekableInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read 在类中 InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip 在类中 InputStreamIOExceptionpublic int available()
throws IOException
available 在类中 InputStreamIOExceptionpublic void mark(int readlimit)
mark 在类中 InputStreampublic void reset()
throws IOException
reset 在类中 InputStreamIOExceptionpublic boolean markSupported()
markSupported 在类中 InputStreampublic void close()
throws IOException
SeekableInputStreamThe close method of InputStream does nothing.
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 SeekableInputStreamIOException - if an I/O error occurs.Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.