private static class ConnectionHolder.FileConnectionHolder extends ConnectionHolder
| Modifier and Type | Field and Description |
|---|---|
private java.io.RandomAccessFile |
file |
buffer, channel| Constructor and Description |
|---|
FileConnectionHolder(java.net.URI uri) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection()
Closes connection when done.
|
(package private) boolean |
isRandomAccess()
Detects whether the source is a random access source.
|
(package private) boolean |
isSeekable()
Detects whether the source is seekable.
|
(package private) boolean |
needBuffer()
Detects whether this source needs buffering at the pipeline level.
|
private java.nio.channels.ReadableByteChannel |
openFile(java.net.URI uri) |
(package private) int |
readBlock(long position,
int size)
Reads a block of data from the arbitrary position of the opened stream.
|
long |
seek(long position)
Performs a seek request to the desired position.
|
createFileConnectionHolder, createHLSConnectionHolder, createMemoryConnectionHolder, createURIConnectionHolder, getBuffer, getStreamSize, property, readNextBlockFileConnectionHolder(java.net.URI uri)
throws java.io.IOException
java.io.IOExceptionboolean needBuffer()
ConnectionHolderneedBuffer in class ConnectionHolderboolean isRandomAccess()
ConnectionHolderisRandomAccess in class ConnectionHolderboolean isSeekable()
ConnectionHolderisSeekable in class ConnectionHolderpublic long seek(long position)
ConnectionHolderseek in class ConnectionHolderint readBlock(long position,
int size)
throws java.io.IOException
ConnectionHolderreadBlock in class ConnectionHolderjava.nio.channels.ClosedChannelException - if an attempt is made to read after
closeConnection has been calledjava.io.IOExceptionprivate java.nio.channels.ReadableByteChannel openFile(java.net.URI uri)
throws java.io.IOException
java.io.IOExceptionpublic void closeConnection()
ConnectionHoldercloseConnection in class ConnectionHolder