public final class JsonCodec extends Object
There is the up-front cost of creating this, and maintenance of this to consider. However, this should be easy to justify as these objects don't change much at all.
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonCodec.JsonReader |
static interface |
JsonCodec.JsonReaderAdapter<T> |
| Constructor and Description |
|---|
JsonCodec() |
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
read(JsonCodec.JsonReaderAdapter<T> adapter,
byte[] bytes,
Collection<T> out) |
static <T> List<T> |
readList(JsonCodec.JsonReaderAdapter<T> adapter,
byte[] bytes) |
static <T> boolean |
readList(JsonCodec.JsonReaderAdapter<T> adapter,
byte[] bytes,
Collection<T> out) |
static <T> T |
readOne(JsonCodec.JsonReaderAdapter<T> adapter,
byte[] bytes) |
static <T> byte[] |
write(Buffer.Writer<T> writer,
T value)
Inability to encode is a programming bug.
|
static <T> byte[] |
writeList(Buffer.Writer<T> writer,
List<T> value) |
static <T> void |
writeList(Buffer.Writer<T> writer,
List<T> value,
Buffer b) |
static <T> int |
writeList(Buffer.Writer<T> writer,
List<T> value,
byte[] out,
int pos) |
public static <T> boolean read(JsonCodec.JsonReaderAdapter<T> adapter, byte[] bytes, Collection<T> out)
@Nullable public static <T> T readOne(JsonCodec.JsonReaderAdapter<T> adapter, byte[] bytes)
public static <T> boolean readList(JsonCodec.JsonReaderAdapter<T> adapter, byte[] bytes, Collection<T> out)
public static <T> List<T> readList(JsonCodec.JsonReaderAdapter<T> adapter, byte[] bytes)
public static <T> byte[] write(Buffer.Writer<T> writer, T value)
public static <T> byte[] writeList(Buffer.Writer<T> writer, List<T> value)
public static <T> int writeList(Buffer.Writer<T> writer, List<T> value, byte[] out, int pos)
public static <T> void writeList(Buffer.Writer<T> writer, List<T> value, Buffer b)
Copyright © 2015–2018 OpenZipkin. All rights reserved.