public final class ProtobufUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <A> A |
fromByteArray(SerializationContext ctx,
byte[] bytes,
Class<A> clazz) |
static <A> A |
fromByteArray(SerializationContext ctx,
byte[] bytes,
int offset,
int length,
Class<A> clazz) |
static <A> A |
fromByteBuffer(SerializationContext ctx,
ByteBuffer byteBuffer,
Class<A> clazz) |
static <A> A |
fromWrappedByteArray(SerializationContext ctx,
byte[] bytes)
Parses a top-level message that was wrapped according to the org.infinispan.protostream.WrappedMessage proto
definition.
|
static <A> A |
fromWrappedByteArray(SerializationContext ctx,
byte[] bytes,
int offset,
int length) |
static <A> A |
fromWrappedByteBuffer(SerializationContext ctx,
ByteBuffer byteBuffer) |
static SerializationContext |
newSerializationContext(Configuration configuration) |
static <A> A |
readFrom(SerializationContext ctx,
InputStream in,
Class<A> clazz) |
static byte[] |
toByteArray(SerializationContext ctx,
Object t) |
static ByteBuffer |
toByteBuffer(SerializationContext ctx,
Object t) |
static String |
toCanonicalJSON(SerializationContext ctx,
byte[] bytes)
See https://developers.google.com/protocol-buffers/docs/proto3#json
|
static String |
toCanonicalJSON(SerializationContext ctx,
byte[] bytes,
boolean prettyPrint)
See https://developers.google.com/protocol-buffers/docs/proto3#json
|
static byte[] |
toWrappedByteArray(SerializationContext ctx,
Object t) |
static ByteBuffer |
toWrappedByteBuffer(SerializationContext ctx,
Object t) |
static void |
writeTo(SerializationContext ctx,
OutputStream out,
Object t) |
public static SerializationContext newSerializationContext(Configuration configuration)
public static void writeTo(SerializationContext ctx, OutputStream out, Object t) throws IOException
IOException
public static byte[] toByteArray(SerializationContext ctx, Object t) throws IOException
IOException
public static ByteBuffer toByteBuffer(SerializationContext ctx, Object t) throws IOException
IOException
public static <A> A readFrom(SerializationContext ctx, InputStream in, Class<A> clazz) throws IOException
IOException
public static <A> A fromByteArray(SerializationContext ctx, byte[] bytes, Class<A> clazz) throws IOException
IOException
public static <A> A fromByteArray(SerializationContext ctx, byte[] bytes, int offset, int length, Class<A> clazz) throws IOException
IOException
public static <A> A fromByteBuffer(SerializationContext ctx, ByteBuffer byteBuffer, Class<A> clazz) throws IOException
IOException
public static <A> A fromWrappedByteArray(SerializationContext ctx, byte[] bytes) throws IOException
ctx
- bytes
- IOException
public static <A> A fromWrappedByteArray(SerializationContext ctx, byte[] bytes, int offset, int length) throws IOException
IOException
public static <A> A fromWrappedByteBuffer(SerializationContext ctx, ByteBuffer byteBuffer) throws IOException
IOException
public static byte[] toWrappedByteArray(SerializationContext ctx, Object t) throws IOException
IOException
public static ByteBuffer toWrappedByteBuffer(SerializationContext ctx, Object t) throws IOException
IOException
public static String toCanonicalJSON(SerializationContext ctx, byte[] bytes) throws IOException
ctx
- bytes
- IOException
public static String toCanonicalJSON(SerializationContext ctx, byte[] bytes, boolean prettyPrint) throws IOException
ctx
- bytes
- prettyPrint
- IOException
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.