public class TypedBytesOutput
extends java.lang.Object
Constructor and Description |
---|
TypedBytesOutput(java.io.DataOutput out)
Creates a new instance of TypedBytesOutput.
|
Modifier and Type | Method and Description |
---|---|
static TypedBytesOutput |
get(java.io.DataOutput out)
Get a thread-local typed bytes output for the supplied
DataOutput . |
void |
write(java.lang.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(java.util.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(java.util.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(java.lang.String s)
Writes a string as a typed bytes sequence.
|
void |
writeVector(java.util.ArrayList vector)
Writes a vector as a typed bytes sequence.
|
void |
writeVectorHeader(int length)
Writes a vector header.
|
public TypedBytesOutput(java.io.DataOutput out)
public static TypedBytesOutput get(java.io.DataOutput out)
DataOutput
.out
- data output objectDataOutput
.public void write(java.lang.Object obj) throws java.io.IOException
obj
- the object to be writtenjava.io.IOException
public void writeRaw(byte[] bytes) throws java.io.IOException
bytes
- the bytes to be writtenjava.io.IOException
public void writeRaw(byte[] bytes, int offset, int length) throws java.io.IOException
bytes
- the bytes to be writtenoffset
- an offset in the given arraylength
- number of bytes from the given array to writejava.io.IOException
public void writeBytes(byte[] bytes, int code) throws java.io.IOException
bytes
- the bytes array to be writtencode
- the typecode to usejava.io.IOException
public void writeBytes(byte[] bytes) throws java.io.IOException
bytes
- the bytes array to be writtenjava.io.IOException
public void writeByte(byte b) throws java.io.IOException
b
- the byte to be writtenjava.io.IOException
public void writeBool(boolean b) throws java.io.IOException
b
- the boolean to be writtenjava.io.IOException
public void writeInt(int i) throws java.io.IOException
i
- the integer to be writtenjava.io.IOException
public void writeLong(long l) throws java.io.IOException
l
- the long to be writtenjava.io.IOException
public void writeFloat(float f) throws java.io.IOException
f
- the float to be writtenjava.io.IOException
public void writeDouble(double d) throws java.io.IOException
d
- the double to be writtenjava.io.IOException
public void writeString(java.lang.String s) throws java.io.IOException
s
- the string to be writtenjava.io.IOException
public void writeVector(java.util.ArrayList vector) throws java.io.IOException
vector
- the vector to be writtenjava.io.IOException
public void writeVectorHeader(int length) throws java.io.IOException
length
- the number of elements in the vectorjava.io.IOException
public void writeList(java.util.List list) throws java.io.IOException
list
- the list to be writtenjava.io.IOException
public void writeListHeader() throws java.io.IOException
java.io.IOException
public void writeListFooter() throws java.io.IOException
java.io.IOException
public void writeMap(java.util.Map map) throws java.io.IOException
map
- the map to be writtenjava.io.IOException
public void writeMapHeader(int length) throws java.io.IOException
length
- the number of key-value pairs in the mapjava.io.IOException
Copyright © 2009 The Apache Software Foundation