public class TypedBytesOutput
extends java.lang.Object
| Constructor | Description |
|---|---|
TypedBytesOutput(java.io.DataOutput out) |
Creates a new instance of TypedBytesOutput.
|
| Modifier and Type | Method | 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 |
writeBytes(byte[] bytes,
int code,
int length) |
Writes a bytes array as a typed bytes sequence, using a given typecode
and length.
|
void |
writeBytes(Buffer buffer) |
Writes a bytes buffer as a typed bytes sequence.
|
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.IOExceptionpublic void writeRaw(byte[] bytes)
throws java.io.IOException
bytes - the bytes to be writtenjava.io.IOExceptionpublic 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.IOExceptionpublic void writeBytes(byte[] bytes,
int code,
int length)
throws java.io.IOException
bytes - the bytes array to be writtencode - the typecode to uselength - the number of bytes to write, starting from position 0java.io.IOExceptionpublic void writeBytes(byte[] bytes,
int code)
throws java.io.IOException
bytes - the bytes array to be writtencode - the typecode to usejava.io.IOExceptionpublic void writeBytes(byte[] bytes)
throws java.io.IOException
bytes - the bytes array to be writtenjava.io.IOExceptionpublic void writeBytes(Buffer buffer) throws java.io.IOException
buffer - the bytes buffer to be writtenjava.io.IOExceptionpublic void writeByte(byte b)
throws java.io.IOException
b - the byte to be writtenjava.io.IOExceptionpublic void writeBool(boolean b)
throws java.io.IOException
b - the boolean to be writtenjava.io.IOExceptionpublic void writeInt(int i)
throws java.io.IOException
i - the integer to be writtenjava.io.IOExceptionpublic void writeLong(long l)
throws java.io.IOException
l - the long to be writtenjava.io.IOExceptionpublic void writeFloat(float f)
throws java.io.IOException
f - the float to be writtenjava.io.IOExceptionpublic void writeDouble(double d)
throws java.io.IOException
d - the double to be writtenjava.io.IOExceptionpublic void writeString(java.lang.String s)
throws java.io.IOException
s - the string to be writtenjava.io.IOExceptionpublic void writeVector(java.util.ArrayList vector)
throws java.io.IOException
vector - the vector to be writtenjava.io.IOExceptionpublic void writeVectorHeader(int length)
throws java.io.IOException
length - the number of elements in the vectorjava.io.IOExceptionpublic void writeList(java.util.List list)
throws java.io.IOException
list - the list to be writtenjava.io.IOExceptionpublic void writeListHeader()
throws java.io.IOException
java.io.IOExceptionpublic void writeListFooter()
throws java.io.IOException
java.io.IOExceptionpublic void writeMap(java.util.Map map)
throws java.io.IOException
map - the map to be writtenjava.io.IOExceptionpublic void writeMapHeader(int length)
throws java.io.IOException
length - the number of key-value pairs in the mapjava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.