Package skadistats.clarity.source
Class LiveSource
java.lang.Object
skadistats.clarity.source.Source
skadistats.clarity.source.LiveSource
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLiveSource
(File file, long timeout, TimeUnit timeUnit) LiveSource
(String fileName, long timeout, TimeUnit timeUnit) LiveSource
(Path filePath, long timeout, TimeUnit timeUnit) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
closes the sourcevoid
int
gets the number of the last tickint
returns the current positionvoid
onDemoStop
(skadistats.clarity.wire.shared.demo.proto.Demo.CDemoStop msg) byte
readByte()
reads a byte from the current positionvoid
readBytes
(byte[] dest, int offset, int length) readslen
bytes and puts them intodst
at the specifiedoffset
void
setPosition
(int position) sets the current positionvoid
stop()
Methods inherited from class skadistats.clarity.source.Source
determineEngineType, determineLastTick, notifyOnLastTickChanged, readBytes, readFixedInt32, readVarInt32, setLastTick, skipBytes, skipVarInt32
-
Field Details
-
log
protected static final org.slf4j.Logger log
-
-
Constructor Details
-
LiveSource
-
LiveSource
-
LiveSource
-
-
Method Details
-
getPosition
public int getPosition()Description copied from class:Source
returns the current position- Specified by:
getPosition
in classSource
- Returns:
- the position
-
setPosition
Description copied from class:Source
sets the current positiondepending on implementation, this might fail when setting a position lower than the current one.
- Specified by:
setPosition
in classSource
- Parameters:
position
- the new position- Throws:
IOException
- if the supplied positions is invalid
-
readByte
Description copied from class:Source
reads a byte from the current position- Specified by:
readByte
in classSource
- Throws:
IOException
- if the data cannot be read
-
readBytes
Description copied from class:Source
readslen
bytes and puts them intodst
at the specifiedoffset
- Specified by:
readBytes
in classSource
- Parameters:
dest
- the byte array to write the data tooffset
- the offset in the byte array where the first byte will be writtenlength
- the number of bytes to read- Throws:
IOException
- if the data cannot be read
-
getLastTick
Description copied from class:Source
gets the number of the last tickCaution: 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 classSource
- Returns:
- the last tick
- Throws:
IOException
- if the position cannot be adjusted, or the data is invalid
-
close
Description copied from class:Source
closes the source- Overrides:
close
in classSource
- Throws:
IOException
- if closing the source fails
-
stop
public void stop() -
forceTimeout
public void forceTimeout()
-