Package com.biglybt.pifimpl.local.disk
Class DiskManagerChannelImpl.request
- java.lang.Object
-
- com.biglybt.pifimpl.local.disk.DiskManagerChannelImpl.request
-
- All Implemented Interfaces:
DiskManagerRequest
- Enclosing class:
- DiskManagerChannelImpl
protected class DiskManagerChannelImpl.request extends java.lang.Object implements DiskManagerRequest
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DiskManagerChannelImpl.request.event
-
Field Summary
Fields Modifier and Type Field Description private boolean
cancelled
private java.util.List<DiskManagerListener>
listeners
private int
max_read_chunk
private long
request_length
private long
request_offset
private int
request_type
private java.lang.String
user_agent
(package private) AESemaphore
wait_sem
-
Fields inherited from interface com.biglybt.pif.disk.DiskManagerRequest
REQUEST_READ
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
request()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(DiskManagerListener listener)
void
cancel()
long
getAvailableBytes()
Get the number of bytes available for immediate reading from the request given its current position.long
getRemaining()
Get the number of bytes remaining to be read for the requestprotected java.lang.String
getUserAgent()
protected void
inform(DiskManagerChannelImpl.request.event ev)
protected void
inform(java.lang.Throwable e)
void
removeListener(DiskManagerListener listener)
void
run()
void
setLength(long _length)
void
setMaximumReadChunkSize(int size)
void
setOffset(long _offset)
void
setType(int _type)
void
setUserAgent(java.lang.String str)
Beware that invoking this method signifies that the media is being streamed and therefore may undergo transformations such as MOOV atom relocation in mp4s
-
-
-
Field Detail
-
request_type
private int request_type
-
request_offset
private long request_offset
-
request_length
private long request_length
-
listeners
private java.util.List<DiskManagerListener> listeners
-
user_agent
private java.lang.String user_agent
-
max_read_chunk
private int max_read_chunk
-
cancelled
private volatile boolean cancelled
-
wait_sem
AESemaphore wait_sem
-
-
Method Detail
-
setType
public void setType(int _type)
- Specified by:
setType
in interfaceDiskManagerRequest
-
setOffset
public void setOffset(long _offset)
- Specified by:
setOffset
in interfaceDiskManagerRequest
-
setLength
public void setLength(long _length)
- Specified by:
setLength
in interfaceDiskManagerRequest
-
setMaximumReadChunkSize
public void setMaximumReadChunkSize(int size)
- Specified by:
setMaximumReadChunkSize
in interfaceDiskManagerRequest
-
getRemaining
public long getRemaining()
Description copied from interface:DiskManagerRequest
Get the number of bytes remaining to be read for the request- Specified by:
getRemaining
in interfaceDiskManagerRequest
- Returns:
-
setUserAgent
public void setUserAgent(java.lang.String str)
Description copied from interface:DiskManagerRequest
Beware that invoking this method signifies that the media is being streamed and therefore may undergo transformations such as MOOV atom relocation in mp4s- Specified by:
setUserAgent
in interfaceDiskManagerRequest
-
getUserAgent
protected java.lang.String getUserAgent()
-
getAvailableBytes
public long getAvailableBytes()
Description copied from interface:DiskManagerRequest
Get the number of bytes available for immediate reading from the request given its current position. If this information is not known (download not running) then -1 is returned- Specified by:
getAvailableBytes
in interfaceDiskManagerRequest
- Returns:
-
run
public void run()
- Specified by:
run
in interfaceDiskManagerRequest
-
cancel
public void cancel()
- Specified by:
cancel
in interfaceDiskManagerRequest
-
inform
protected void inform(java.lang.Throwable e)
-
inform
protected void inform(DiskManagerChannelImpl.request.event ev)
-
addListener
public void addListener(DiskManagerListener listener)
- Specified by:
addListener
in interfaceDiskManagerRequest
-
removeListener
public void removeListener(DiskManagerListener listener)
- Specified by:
removeListener
in interfaceDiskManagerRequest
-
-