public interface DataWriter
Top-level, only object must be written. Therefore, the first call to a
DataWriter must be beginObject().
beginObject()| Modifier and Type | Method and Description |
|---|---|
void |
beginArray(DataType type,
int lenght)
Starts writing an array value with entries of the given type.
|
void |
beginObject()
Starts writing an object.
|
void |
endArray()
Stops writing the array started with the last call to
beginObject(). |
void |
endObject()
Finishes writing the fields of the object started with the last call to
beginObject(). |
void |
name(int id)
Writes an identifier of a field fo the currently written object.
|
default void |
value(boolean value)
Writes a
boolean value. |
void |
value(byte[] value)
Writes a binary string value.
|
void |
value(double value)
Writes a
double value. |
void |
value(float value)
Writes a
float value. |
void |
value(int value)
Writes an unsigned
int value. |
void |
value(long value)
Writes an unsigned
long value. |
void |
value(String value)
Writes a
String value in utf-8 encoding. |
void |
valueFixed(int value)
Writes a fixed size 32 bit
int value. |
void |
valueFixed(long value)
Writes a fixed size 64 bit
long value. |
void |
valueSigned(int value)
Writes a signed
int value. |
void |
valueSigned(long value)
Writes a signed
long value. |
void beginObject()
throws IOException
A sequence of interleaving calls to name(int) and a value
encoding method such as value(int) is expected followed by a
final endObject() call.
IOExceptionvoid endObject()
throws IOException
beginObject().IOExceptionvoid name(int id) throws IOException
IOExceptiondefault void value(boolean value)
throws IOException
boolean value.IOExceptionvoid value(int value)
throws IOException
int value.IOExceptionvoid valueSigned(int value)
throws IOException
int value.IOExceptionvoid valueFixed(int value)
throws IOException
int value.IOExceptionvoid value(long value)
throws IOException
long value.IOExceptionvoid valueSigned(long value)
throws IOException
long value.IOExceptionvoid valueFixed(long value)
throws IOException
long value.IOExceptionvoid value(float value)
throws IOException
float value.IOExceptionvoid value(double value)
throws IOException
double value.IOExceptionvoid value(String value) throws IOException
String value in utf-8 encoding.IOExceptionvoid value(byte[] value)
throws IOException
IOExceptionvoid beginArray(DataType type, int lenght) throws IOException
type - The type of the array elements.lenght - The number of elements that follow.IOExceptionvoid endArray()
throws IOException
beginObject().IOExceptionCopyright © 2021. All rights reserved.