public class JsonWritable extends Object implements org.apache.hadoop.io.Writable
Constructor and Description |
---|
JsonWritable()
Creates an empty
JsonWritable . |
JsonWritable(String s)
Creates a
JsonWritable with an initial value. |
Modifier and Type | Method and Description |
---|---|
static JsonWritable |
create(byte[] bytes) |
static JsonWritable |
create(DataInput in) |
com.google.gson.JsonObject |
getJsonObject() |
void |
readFields(DataInput in)
Deserializes a
JsonWritable object. |
byte[] |
serialize()
Returns the serialized representation of this object as a byte array.
|
String |
toString() |
void |
write(DataOutput out)
Serializes this object.
|
public JsonWritable()
JsonWritable
.public JsonWritable(String s)
JsonWritable
with an initial value.public void readFields(DataInput in) throws IOException
JsonWritable
object.readFields
in interface org.apache.hadoop.io.Writable
in
- source for raw byte representationIOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
out
- where to write the raw byte representationIOException
public byte[] serialize() throws IOException
IOException
public com.google.gson.JsonObject getJsonObject()
public static JsonWritable create(DataInput in) throws IOException
IOException
public static JsonWritable create(byte[] bytes) throws IOException
IOException
Copyright © 2018. All rights reserved.