public class TypedBytesOutput extends Object
Constructor and Description |
---|
TypedBytesOutput(DataOutput out)
Creates a new instance of TypedBytesOutput.
|
Modifier and Type | Method and Description |
---|---|
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 |
writeEndOfRecord() |
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 |
writeNull()
Writes a NULL type marker to the output.
|
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 |
writeShort(short s)
Writes a short as a typed bytes sequence.
|
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 writtenIOException
public void writeRaw(byte[] bytes) throws IOException
bytes
- the bytes to be writtenIOException
public 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 writeIOException
public void writeBytes(byte[] bytes, int code) throws IOException
bytes
- the bytes array to be writtencode
- the typecode to useIOException
public void writeBytes(byte[] bytes) throws IOException
bytes
- the bytes array to be writtenIOException
public void writeByte(byte b) throws IOException
b
- the byte to be writtenIOException
public void writeBool(boolean b) throws IOException
b
- the boolean to be writtenIOException
public void writeInt(int i) throws IOException
i
- the integer to be writtenIOException
public void writeLong(long l) throws IOException
l
- the long to be writtenIOException
public void writeFloat(float f) throws IOException
f
- the float to be writtenIOException
public void writeDouble(double d) throws IOException
d
- the double to be writtenIOException
public void writeShort(short s) throws IOException
s
- the short to be writtenIOException
public void writeString(String s) throws IOException
s
- the string to be writtenIOException
public void writeVector(ArrayList vector) throws IOException
vector
- the vector to be writtenIOException
public void writeVectorHeader(int length) throws IOException
length
- the number of elements in the vectorIOException
public void writeList(List list) throws IOException
list
- the list to be writtenIOException
public void writeListHeader() throws IOException
IOException
public void writeListFooter() throws IOException
IOException
public void writeMap(Map map) throws IOException
map
- the map to be writtenIOException
public void writeMapHeader(int length) throws IOException
length
- the number of key-value pairs in the mapIOException
public void writeEndOfRecord() throws IOException
IOException
public void writeNull() throws IOException
IOException
Copyright © 2017 The Apache Software Foundation. All rights reserved.