at.borkowski.spicej.streams

Class RateLimitOutputStream

    • Constructor Detail

      • RateLimitOutputStream

        public RateLimitOutputStream(OutputStream real,                             TickSource tickSource,                             int byteRate,                             int prescale)
        Constructs a byte-rate-limited OutputStream. See RateLimitInputStream for a description of the rate parameters (byteRate and prescale).
        Parameters:
        real - The raw OutputStream to send to
        tickSource - The tick source to use
        byteRate - The rate in bytes per tick (before prescaler) to use
        prescale - The prescaler to use (see RateLimitInputStream)
    • Method Detail

      • setByteRate

        public void setByteRate(int bytesPerTick)
        Description copied from interface: RateShaper
        Sets a new byte rate per tick (after prescaling) for this rate shaper.
        Specified by:
        setByteRate in interface RateShaper
        Parameters:
        bytesPerTick - the new byte rate per tick (after prescaling)
      • getByteRate

        public int getByteRate()
        Description copied from interface: RateShaper
        Returns the bytes per tick (after prescaling) for this rate shaper.
        Specified by:
        getByteRate in interface RateShaper
        Returns:
        the current byte rate
      • setNonBlocking

        public void setNonBlocking(boolean nonBlocking)
        Sets the non-blocking flag.
        Parameters:
        nonBlocking - whether the stream should be in non-blocking mode (see RateLimitInputStream).
      • getPrescale

        public int getPrescale()
        Description copied from interface: RateShaper
        Returns the current prescale value (ie. one of how many ticks is actually counting towards the things per tick notion).
        Specified by:
        getPrescale in interface RateShaper
        Returns:
        the current prescale value
      • setPrescale

        public void setPrescale(int prescale)
        Description copied from interface: RateShaper
        Sets a new prescale value (ie. one of how many ticks is actually counting towards the things per tick notion).
        Specified by:
        setPrescale in interface RateShaper
        Parameters:
        prescale - the new prescale
      • getTickSource

        public TickSource getTickSource()
        Returns the TickSource this stream uses.
        Returns:
        the used tick source

Copyright © 2015. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14