public class TypedBytesOutput extends Object
| 构造器和说明 |
|---|
TypedBytesOutput(DataOutput out)
Creates a new instance of TypedBytesOutput.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static TypedBytesOutput |
get(DataOutput out)
Get a thread-local typed bytes output for the supplied
DataOutput. |
void |
write(Object obj)
Writes a Java object as a typed bytes sequence.
|
void |
writeBool(boolean b)
Writes a boolean as a typed bytes sequence.
|
void |
writeByte(byte b)
Writes a byte as a typed bytes sequence.
|
void |
writeBytes(byte[] bytes)
Writes a bytes array as a typed bytes sequence.
|
void |
writeBytes(byte[] bytes,
int code)
Writes a bytes array as a typed bytes sequence, using a given typecode.
|
void |
writeDouble(double d)
Writes a double as a typed bytes sequence.
|
void |
writeFloat(float f)
Writes a float as a typed bytes sequence.
|
void |
writeInt(int i)
Writes an integer as a typed bytes sequence.
|
void |
writeList(List list)
Writes a list as a typed bytes sequence.
|
void |
writeListFooter()
Writes a list footer.
|
void |
writeListHeader()
Writes a list header.
|
void |
writeLong(long l)
Writes a long as a typed bytes sequence.
|
void |
writeMap(Map map)
Writes a map as a typed bytes sequence.
|
void |
writeMapHeader(int length)
Writes a map header.
|
void |
writeRaw(byte[] bytes)
Writes a raw sequence of typed bytes.
|
void |
writeRaw(byte[] bytes,
int offset,
int length)
Writes a raw sequence of typed bytes.
|
void |
writeString(String s)
Writes a string as a typed bytes sequence.
|
void |
writeVector(ArrayList vector)
Writes a vector as a typed bytes sequence.
|
void |
writeVectorHeader(int length)
Writes a vector header.
|
public TypedBytesOutput(DataOutput out)
public static TypedBytesOutput get(DataOutput out)
DataOutput.out - data output objectDataOutput.public void write(Object obj) throws IOException
obj - the object to be writtenIOExceptionpublic void writeRaw(byte[] bytes)
throws IOException
bytes - the bytes to be writtenIOExceptionpublic void writeRaw(byte[] bytes,
int offset,
int length)
throws IOException
bytes - the bytes to be writtenoffset - an offset in the given arraylength - number of bytes from the given array to writeIOExceptionpublic void writeBytes(byte[] bytes,
int code)
throws IOException
bytes - the bytes array to be writtencode - the typecode to useIOExceptionpublic void writeBytes(byte[] bytes)
throws IOException
bytes - the bytes array to be writtenIOExceptionpublic void writeByte(byte b)
throws IOException
b - the byte to be writtenIOExceptionpublic void writeBool(boolean b)
throws IOException
b - the boolean to be writtenIOExceptionpublic void writeInt(int i)
throws IOException
i - the integer to be writtenIOExceptionpublic void writeLong(long l)
throws IOException
l - the long to be writtenIOExceptionpublic void writeFloat(float f)
throws IOException
f - the float to be writtenIOExceptionpublic void writeDouble(double d)
throws IOException
d - the double to be writtenIOExceptionpublic void writeString(String s) throws IOException
s - the string to be writtenIOExceptionpublic void writeVector(ArrayList vector) throws IOException
vector - the vector to be writtenIOExceptionpublic void writeVectorHeader(int length)
throws IOException
length - the number of elements in the vectorIOExceptionpublic void writeList(List list) throws IOException
list - the list to be writtenIOExceptionpublic void writeListHeader()
throws IOException
IOExceptionpublic void writeListFooter()
throws IOException
IOExceptionpublic void writeMap(Map map) throws IOException
map - the map to be writtenIOExceptionpublic void writeMapHeader(int length)
throws IOException
length - the number of key-value pairs in the mapIOExceptionCopyright © 2009 The Apache Software Foundation