Class BandwidthThrottlerImpl
- java.lang.Object
-
- com.amazonaws.kinesisvideo.stream.throttling.BandwidthThrottlerImpl
-
- All Implemented Interfaces:
BandwidthThrottler
public class BandwidthThrottlerImpl extends Object implements BandwidthThrottler
A bandwidth throttler for output stream (i.e. upload).The maximum upstream kbps can be set via
setUpstreamKbps(long). Note that, 'byte' will be explicitly called out. Any 'b' or 'B' (in variable names with camel case) will refer to bit.TODO: implement for input.
-
-
Constructor Summary
Constructors Constructor Description BandwidthThrottlerImpl(long maxBps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAllowedBytes(int len)Get the allowed number of bytes to read from or write to socket.voidsetAbsoluteMaxBps(long maxBps)voidsetUpstreamKbps(long kbps)Set upload max bandwidth in kilobits per seconds.
-
-
-
Method Detail
-
setAbsoluteMaxBps
public void setAbsoluteMaxBps(long maxBps)
-
setUpstreamKbps
public void setUpstreamKbps(long kbps)
Description copied from interface:BandwidthThrottlerSet upload max bandwidth in kilobits per seconds.- Specified by:
setUpstreamKbpsin interfaceBandwidthThrottler- Parameters:
kbps- max bandwidth in kbps
-
getAllowedBytes
public int getAllowedBytes(int len)
Description copied from interface:BandwidthThrottlerGet the allowed number of bytes to read from or write to socket.- Specified by:
getAllowedBytesin interfaceBandwidthThrottler- Parameters:
len- maximum number of bytes.- Returns:
- allowed bytes
-
-