Class LiveSource

java.lang.Object
skadistats.clarity.source.Source
skadistats.clarity.source.LiveSource

public class LiveSource extends Source
  • Field Details

    • log

      protected static final org.slf4j.Logger log
  • Constructor Details

    • LiveSource

      public LiveSource(String fileName, long timeout, TimeUnit timeUnit)
    • LiveSource

      public LiveSource(File file, long timeout, TimeUnit timeUnit)
    • LiveSource

      public LiveSource(Path filePath, long timeout, TimeUnit timeUnit)
  • Method Details

    • getPosition

      public int getPosition()
      Description copied from class: Source
      returns the current position
      Specified by:
      getPosition in class Source
      Returns:
      the position
    • setPosition

      public void setPosition(int position) throws IOException
      Description copied from class: Source
      sets the current position

      depending on implementation, this might fail when setting a position lower than the current one.

      Specified by:
      setPosition in class Source
      Parameters:
      position - the new position
      Throws:
      IOException - if the supplied positions is invalid
    • readByte

      public byte readByte() throws IOException
      Description copied from class: Source
      reads a byte from the current position
      Specified by:
      readByte in class Source
      Throws:
      IOException - if the data cannot be read
    • readBytes

      public void readBytes(byte[] dest, int offset, int length) throws IOException
      Description copied from class: Source
      reads len bytes and puts them into dst at the specified offset
      Specified by:
      readBytes in class Source
      Parameters:
      dest - the byte array to write the data to
      offset - the offset in the byte array where the first byte will be written
      length - the number of bytes to read
      Throws:
      IOException - if the data cannot be read
    • getLastTick

      public int getLastTick() throws IOException
      Description copied from class: Source
      gets the number of the last tick

      Caution: this will set the position to the end of the data. If the implementation does not support setting the position to a lower value, you will not be able to use this source for further processing.

      Overrides:
      getLastTick in class Source
      Returns:
      the last tick
      Throws:
      IOException - if the position cannot be adjusted, or the data is invalid
    • close

      public void close() throws IOException
      Description copied from class: Source
      closes the source
      Overrides:
      close in class Source
      Throws:
      IOException - if closing the source fails
    • stop

      public void stop()
    • forceTimeout

      public void forceTimeout()
    • onDemoStop

      public void onDemoStop(skadistats.clarity.wire.shared.demo.proto.Demo.CDemoStop msg)