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) |
float |
readFloat(InputStream in) |
float[] |
readFloats(InputStream in) |
int |
readInt(InputStream in) |
int[] |
readInts(InputStream in) |
long |
readLong(InputStream in) |
long[] |
readLongs(InputStream in) |
String |
readString(ByteBuffer in) |
String |
readString(InputStream in) |
String[] |
readStrings(ByteBuffer in) |
String[] |
readStrings(InputStream 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.
|
static void |
writeBigEndianLongToOutputStream(OutputStream out,
long value,
ByteBuffer helperBuffer)
Writes the given long value into the given OutputStream in big-endian byte order, using the helperBuffer.
|
void |
writeFloat(OutputStream out,
float floatValue) |
void |
writeFloat(WritableByteChannel out,
float floatValue) |
void |
writeFloats(OutputStream out,
float[] floats) |
void |
writeInt(OutputStream out,
int intValue) |
void |
writeInt(WritableByteChannel out,
int intValue) |
void |
writeInts(OutputStream out,
int[] ints) |
void |
writeInts(OutputStream out,
IntList ints) |
void |
writeLong(OutputStream out,
long longValue) |
void |
writeLong(WritableByteChannel out,
long longValue) |
void |
writeLongs(OutputStream out,
long[] longs) |
static void |
writeNativeOrderedIntToOutputStream(OutputStream out,
int value,
ByteBuffer helperBuffer)
Writes the given int value into the given OutputStream in the native byte order, using the given helperBuffer.
|
static void |
writeNativeOrderedLongToOutputStream(OutputStream out,
long value,
ByteBuffer helperBuffer)
Writes the given long value into the given OutputStream in the native byte order, using the helperBuffer.
|
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) |
void |
writeStrings(OutputStream out,
List<String> names) |
void |
writeStrings(OutputStream out,
String[] names) |
public static void writeBigEndianLongToOutputStream(OutputStream out, long value, ByteBuffer helperBuffer) throws IOException
DataOutputStream.helperBuffer - a big-endian heap ByteBuffer with capacity of at least 8IOExceptionpublic static void writeNativeOrderedLongToOutputStream(OutputStream out, long value, ByteBuffer helperBuffer) throws IOException
helperBuffer - a heap ByteBuffer with capacity of at least 8, with the native byte orderIOExceptionpublic static void writeBigEndianIntToOutputStream(OutputStream out, int value, ByteBuffer helperBuffer) throws IOException
DataOutputStream.helperBuffer - a big-endian heap ByteBuffer with capacity of at least 4IOExceptionpublic static void writeNativeOrderedIntToOutputStream(OutputStream out, int value, ByteBuffer helperBuffer) throws IOException
helperBuffer - a heap ByteBuffer with capacity of at least 4, with the native byte orderIOExceptionpublic <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(InputStream in) throws IOException
IOExceptionpublic String readString(ByteBuffer in) throws IOException
IOExceptionpublic byte[] readBytes(ByteBuffer in, int length) throws IOException
IOExceptionpublic void writeStrings(OutputStream out, String[] names) throws IOException
IOExceptionpublic void writeStrings(OutputStream out, List<String> names) throws IOException
IOExceptionpublic String[] readStrings(InputStream in) throws IOException
IOExceptionpublic String[] readStrings(ByteBuffer in) throws IOException
IOExceptionpublic void writeInt(OutputStream out, int intValue) throws IOException
IOExceptionpublic void writeInt(WritableByteChannel out, int intValue) throws IOException
IOExceptionpublic int readInt(InputStream in) throws IOException
IOExceptionpublic void writeInts(OutputStream out, int[] ints) throws IOException
IOExceptionpublic void writeInts(OutputStream out, IntList ints) throws IOException
IOExceptionpublic int[] readInts(InputStream in) throws IOException
IOExceptionpublic void writeLong(OutputStream out, long longValue) throws IOException
IOExceptionpublic void writeLong(WritableByteChannel out, long longValue) throws IOException
IOExceptionpublic long readLong(InputStream in) throws IOException
IOExceptionpublic void writeLongs(OutputStream out, long[] longs) throws IOException
IOExceptionpublic long[] readLongs(InputStream in) throws IOException
IOExceptionpublic void writeFloat(OutputStream out, float floatValue) throws IOException
IOExceptionpublic void writeFloat(WritableByteChannel out, float floatValue) throws IOException
IOExceptionpublic float readFloat(InputStream in) throws IOException
IOExceptionpublic void writeFloats(OutputStream out, float[] floats) throws IOException
IOExceptionpublic float[] readFloats(InputStream in) throws IOException
IOExceptionpublic int getSerializedStringByteSize(String str)
Copyright © 2011–2017. All rights reserved.