public class SerializerUtils extends Object
Constructor and Description |
---|
SerializerUtils() |
Modifier and Type | Method and Description |
---|---|
int |
getSerializedStringByteSize(String str) |
byte[] |
readBytes(ByteBuffer in,
int length) |
String |
readString(ByteBuffer in) |
static void |
writeBigEndianIntToOutputStream(OutputStream out,
int value,
ByteBuffer helperBuffer)
Writes the given int value into the given OutputStream in big-endian byte order, using the helperBuffer.
|
void |
writeFloat(OutputStream out,
float floatValue) |
void |
writeLong(WritableByteChannel out,
long longValue) |
void |
writeString(com.google.common.io.OutputSupplier<? extends OutputStream> supplier,
String name) |
<T extends OutputStream> |
writeString(T out,
String name) |
void |
writeString(WritableByteChannel out,
String name) |
public static void writeBigEndianIntToOutputStream(OutputStream out, int value, ByteBuffer helperBuffer) throws IOException
DataOutputStream
.helperBuffer
- a big-endian heap ByteBuffer with capacity of at least 4IOException
public <T extends OutputStream> void writeString(T out, String name) throws IOException
IOException
public void writeString(com.google.common.io.OutputSupplier<? extends OutputStream> supplier, String name) throws IOException
IOException
public void writeString(WritableByteChannel out, String name) throws IOException
IOException
public String readString(ByteBuffer in) throws IOException
IOException
public byte[] readBytes(ByteBuffer in, int length) throws IOException
IOException
public void writeLong(WritableByteChannel out, long longValue) throws IOException
IOException
public void writeFloat(OutputStream out, float floatValue) throws IOException
IOException
public int getSerializedStringByteSize(String str)
Copyright © 2011–2018. All rights reserved.