| Constructor and Description |
|---|
JsonEncoder(com.google.gson.stream.JsonWriter jsonWriter) |
| Modifier and Type | Method and Description |
|---|---|
Encoder |
writeBool(boolean b)
Writes out a boolean value.
|
Encoder |
writeBytes(byte[] bytes)
Writes out a byte array.
|
Encoder |
writeBytes(byte[] bytes,
int off,
int len)
Writes out a byte array.
|
Encoder |
writeBytes(ByteBuffer bytes)
Writes out the remaining bytes in
ByteBuffer. |
Encoder |
writeDouble(double d)
Writes out a double value.
|
Encoder |
writeFloat(float f)
Writes out a float value.
|
Encoder |
writeInt(int i)
Writes out a int value.
|
Encoder |
writeLong(long l)
Writes out a long value.
|
Encoder |
writeNull()
Writes out a null value.
|
Encoder |
writeString(String s)
Writes out a string value.
|
public Encoder writeNull() throws IOException
EncoderwriteNull in interface EncoderIOException - if failed to encodepublic Encoder writeBool(boolean b) throws IOException
EncoderwriteBool in interface Encoderb - the value to writeIOException - if failed to encodepublic Encoder writeInt(int i) throws IOException
EncoderwriteInt in interface Encoderi - the value to writeIOException - if failed to encodepublic Encoder writeLong(long l) throws IOException
EncoderwriteLong in interface Encoderl - the value to writeIOException - if failed to encodepublic Encoder writeFloat(float f) throws IOException
EncoderwriteFloat in interface Encoderf - the value to writeIOException - if failed to encodepublic Encoder writeDouble(double d) throws IOException
EncoderwriteDouble in interface Encoderd - the value to writeIOException - if failed to encodepublic Encoder writeString(String s) throws IOException
EncoderwriteString in interface Encoders - the value to writeIOException - if failed to encodepublic Encoder writeBytes(byte[] bytes) throws IOException
EncoderwriteBytes in interface Encoderbytes - the value to writeIOException - if failed to encodepublic Encoder writeBytes(byte[] bytes, int off, int len) throws IOException
EncoderwriteBytes in interface Encoderbytes - the value to writeoff - the starting offset in the byte array to writelen - number of bytes to write, starting from the given offsetIOException - if failed to encodepublic Encoder writeBytes(ByteBuffer bytes) throws IOException
EncoderByteBuffer.
The given ByteBuffer is untounch after this method is returned (i.e. same position and limit).writeBytes in interface Encoderbytes - bytes to writeIOException - if failed to encodeCopyright © 2018 Cask Data, Inc. Licensed under the Apache License, Version 2.0.