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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private List
<DiskManagerListener> private int
private long
private long
private int
private String
(package private) AESemaphore
Fields inherited from interface com.biglybt.pif.disk.DiskManagerRequest
REQUEST_READ
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(DiskManagerListener listener) void
cancel()
long
Get the number of bytes available for immediate reading from the request given its current position.long
Get the number of bytes remaining to be read for the requestprotected String
protected void
protected void
void
removeListener
(DiskManagerListener listener) void
run()
void
setLength
(long _length) void
setMaximumReadChunkSize
(int size) void
setOffset
(long _offset) void
setType
(int _type) void
setUserAgent
(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 Details
-
request_type
private int request_type -
request_offset
private long request_offset -
request_length
private long request_length -
listeners
-
user_agent
-
max_read_chunk
private int max_read_chunk -
cancelled
private volatile boolean cancelled -
wait_sem
AESemaphore wait_sem
-
-
Constructor Details
-
request
protected request()
-
-
Method Details
-
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
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
- Parameters:
str
-
-
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
-
inform
-
addListener
- Specified by:
addListener
in interfaceDiskManagerRequest
-
removeListener
- Specified by:
removeListener
in interfaceDiskManagerRequest
-