Class VarIntType
java.lang.Object
com.viaversion.viaversion.api.type.Type<Integer>
com.viaversion.viaversion.api.type.types.VarIntType
- All Implemented Interfaces:
ByteBufReader<Integer>
,ByteBufWriter<Integer>
,TypeConverter<Integer>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionConvert from a type to the current typeread
(io.netty.buffer.ByteBuf buffer) Deprecated.int
readPrimitive
(io.netty.buffer.ByteBuf buffer) void
Deprecated.usewritePrimitive(ByteBuf, int)
for manual reading to avoid wrappingvoid
writePrimitive
(io.netty.buffer.ByteBuf buffer, int value) Methods inherited from class com.viaversion.viaversion.api.type.Type
getBaseClass, getOutputClass, getTypeName, readEither, toString, writeEither
-
Constructor Details
-
VarIntType
public VarIntType()
-
-
Method Details
-
readPrimitive
public int readPrimitive(io.netty.buffer.ByteBuf buffer) -
writePrimitive
public void writePrimitive(io.netty.buffer.ByteBuf buffer, int value) -
read
Deprecated.usereadPrimitive(ByteBuf)
for manual reading to avoid wrappingDescription copied from interface:ByteBufReader
Reads a value from a ByteBuf.- Specified by:
read
in interfaceByteBufReader<Integer>
- Parameters:
buffer
- buffer to read from- Returns:
- type based on the class type
-
write
Deprecated.usewritePrimitive(ByteBuf, int)
for manual reading to avoid wrappingDescription copied from interface:ByteBufWriter
Writes an object to a type to a ByteBuf.- Specified by:
write
in interfaceByteBufWriter<Integer>
- Parameters:
buffer
- buffer to write toobject
- value to write
-
from
Description copied from interface:TypeConverter
Convert from a type to the current type- Specified by:
from
in interfaceTypeConverter<Integer>
- Parameters:
o
- The input object- Returns:
- The converted type as an object
-
readPrimitive(ByteBuf)
for manual reading to avoid wrapping