Package ai.djl.python.engine
Class CodecUtils
java.lang.Object
ai.djl.python.engine.CodecUtils
This is a utility class for reading and writing to netty ByteBuf.
-
Field Summary
-
Method Summary
-
Field Details
-
MAX_BUFFER_SIZE
public static final int MAX_BUFFER_SIZE- See Also:
-
-
Method Details
-
readBytes
public static byte[] readBytes(io.netty.buffer.ByteBuf in, int maxLength) Reads the specified length of data.- Parameters:
in
- byte buffermaxLength
- length of the data to be read- Returns:
- read data
-
readUtf8
Read a String from theByteBuf
.- Parameters:
in
- theByteBuf
.- Returns:
- a string read from the buffer.
-
writeUtf8
Encode a String in UTF-8 and write it to theByteBuf
.- Parameters:
buf
- theByteBuf
.value
- the string to write into a buffer.
-