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, readNextBlock
FileConnectionHolder(java.net.URI uri) throws java.io.IOException
java.io.IOException
boolean needBuffer()
ConnectionHolder
needBuffer
in class ConnectionHolder
boolean isRandomAccess()
ConnectionHolder
isRandomAccess
in class ConnectionHolder
boolean isSeekable()
ConnectionHolder
isSeekable
in class ConnectionHolder
public long seek(long position)
ConnectionHolder
seek
in class ConnectionHolder
int readBlock(long position, int size) throws java.io.IOException
ConnectionHolder
readBlock
in class ConnectionHolder
java.nio.channels.ClosedChannelException
- if an attempt is made to read after
closeConnection has been calledjava.io.IOException
private java.nio.channels.ReadableByteChannel openFile(java.net.URI uri) throws java.io.IOException
java.io.IOException
public void closeConnection()
ConnectionHolder
closeConnection
in class ConnectionHolder