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 4IOExceptionpublic <T extends OutputStream> void writeString(T out, String name) throws IOException
IOExceptionpublic void writeString(com.google.common.io.OutputSupplier<? extends OutputStream> supplier, String name) throws IOException
IOExceptionpublic void writeString(WritableByteChannel out, String name) throws IOException
IOExceptionpublic String readString(ByteBuffer in) throws IOException
IOExceptionpublic byte[] readBytes(ByteBuffer in, int length) throws IOException
IOExceptionpublic void writeLong(WritableByteChannel out, long longValue) throws IOException
IOExceptionpublic void writeFloat(OutputStream out, float floatValue) throws IOException
IOExceptionpublic int getSerializedStringByteSize(String str)
Copyright © 2011–2018. All rights reserved.