public abstract class ByteRangeInputStream extends FSInputStream
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ByteRangeInputStream.URLOpener
This class wraps a URL and provides method to open connection.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected long |
currentPos |
protected Long |
fileLength |
protected InputStream |
in |
protected ByteRangeInputStream.URLOpener |
originalURL |
protected ByteRangeInputStream.URLOpener |
resolvedURL |
protected long |
startPos |
| 构造器和说明 |
|---|
ByteRangeInputStream(ByteRangeInputStream.URLOpener o,
ByteRangeInputStream.URLOpener r)
Create with the specified URLOpeners.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
protected InputStream |
getInputStream() |
long |
getPos()
Return the current offset from the start of the file
|
protected abstract URL |
getResolvedUrl(HttpURLConnection connection) |
protected InputStream |
openInputStream() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
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.
|
read, readFully, readFullyavailable, mark, markSupported, read, reset, skipprotected InputStream in
protected ByteRangeInputStream.URLOpener originalURL
protected ByteRangeInputStream.URLOpener resolvedURL
protected long startPos
protected long currentPos
protected Long fileLength
public ByteRangeInputStream(ByteRangeInputStream.URLOpener o, ByteRangeInputStream.URLOpener r)
o - Original urlr - Resolved urlprotected abstract URL getResolvedUrl(HttpURLConnection connection) throws IOException
IOExceptionprotected InputStream getInputStream() throws IOException
IOExceptionprotected InputStream openInputStream() throws IOException
IOExceptionpublic int read()
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read 在类中 InputStreamIOExceptionpublic void seek(long pos)
throws IOException
seek 在接口中 Seekableseek 在类中 FSInputStreamIOExceptionpublic long getPos()
throws IOException
getPos 在接口中 SeekablegetPos 在类中 FSInputStreamIOExceptionpublic boolean seekToNewSource(long targetPos)
throws IOException
seekToNewSource 在接口中 SeekableseekToNewSource 在类中 FSInputStreamIOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 InputStreamIOExceptionCopyright © 2009 The Apache Software Foundation