Object
de.sayayi.lib.pack.PackInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPackInputStream(@NotNull PackConfig packConfig, @NotNull InputStream stream) PackInputStream(@NotNull InputStream stream) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclose()protected voidbooleanprotected byteread()boolean<T extends Enum<T>>
T<T extends Enum<T>>
TreadEnum(@NotNull Class<T> enumType, @org.jetbrains.annotations.Range(from=1L, to=16L) int bitWidth) intreadInt()longreadLarge(@org.jetbrains.annotations.Range(from=9L, to=64L) int bitWidth) longreadLong()@org.jetbrains.annotations.Range(from=0L, to=255L) intreadSmall(@org.jetbrains.annotations.Range(from=1L, to=8L) int bitWidth) @org.jetbrains.annotations.Range(from=0L, to=255L) intRanges: 0..7 (4 bit), 8..15 (5 bit), 16..255 (10 bit)@org.jetbrains.annotations.Range(from=0L, to=65535L) intvoidskip(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int bitWidth) void<T extends Enum<T>>
voidvoidskipInt()voidskipLong()voidvoidvoid
-
Constructor Details
-
PackInputStream
@Contract(mutates="param1,io") public PackInputStream(@NotNull @NotNull InputStream stream) throws IOException - Throws:
IOException- Since:
- 0.1.2
-
PackInputStream
@Contract(mutates="param2,io") public PackInputStream(@NotNull @NotNull PackConfig packConfig, @NotNull @NotNull InputStream stream) throws IOException - Throws:
IOException
-
-
Method Details
-
isCompressed
-
getVersion
-
readBoolean
- Throws:
IOException
-
skipBoolean
- Throws:
IOException
-
readEnum
@Contract(mutates="this,io") @NotNull public <T extends Enum<T>> T readEnum(@NotNull @NotNull Class<T> enumType, @org.jetbrains.annotations.Range(from=1L, to=16L) int bitWidth) throws IOException - Throws:
IOException
-
readEnum
@Contract(mutates="this,io") @NotNull public <T extends Enum<T>> T readEnum(@NotNull @NotNull Class<T> enumType) throws IOException - Throws:
IOException
-
skipEnum
@Contract(mutates="this,io") public <T extends Enum<T>> void skipEnum(@NotNull @NotNull Class<T> enumType) throws IOException - Throws:
IOException
-
readUnsignedShort
@Contract(mutates="this,io") public @org.jetbrains.annotations.Range(from=0L, to=65535L) int readUnsignedShort() throws IOException- Returns:
- unsigned value (0..65535)
- Throws:
IOException- if an I/O error occurs
-
skipUnsignedShort
- Throws:
IOException
-
readInt
- Throws:
IOException
-
skipInt
- Throws:
IOException
-
readLong
- Throws:
IOException
-
skipLong
- Throws:
IOException
-
readString
- Throws:
IOException
-
skipString
- Throws:
IOException
-
readSmallVar
@Contract(mutates="this,io") public @org.jetbrains.annotations.Range(from=0L, to=255L) int readSmallVar() throws IOExceptionRanges: 0..7 (4 bit), 8..15 (5 bit), 16..255 (10 bit)- Returns:
- value in range 0..255
- Throws:
IOException- if an I/O error occurs
-
skipSmallVar
- Throws:
IOException
-
readSmall
@Contract(mutates="this,io") public @org.jetbrains.annotations.Range(from=0L, to=255L) int readSmall(@org.jetbrains.annotations.Range(from=1L, to=8L) int bitWidth) throws IOException - Parameters:
bitWidth- bit width (1..8)- Returns:
- value in range 0..255
- Throws:
IOException- if an I/O error occurs
-
readLarge
@Contract(mutates="this,io") public long readLarge(@org.jetbrains.annotations.Range(from=9L, to=64L) int bitWidth) throws IOException - Parameters:
bitWidth- bit width (9..64)- Returns:
- long value
- Throws:
IOException- if an I/O error occurs
-
assertData
- Throws:
IOException
-
forceByteAlignment
-
skip
@Contract(mutates="this,io") public void skip(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int bitWidth) throws IOException - Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
read
- Throws:
IOException
-