|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dyuproject.protostuff.ProtobufIOUtil
public final class ProtobufIOUtil
Protobuf ser/deser util for messages/objects.
| Method Summary | ||
|---|---|---|
static
|
mergeDelimitedFrom(java.io.DataInput in,
T message,
Schema<T> schema)
Used by the code generated messages that implement Externalizable. |
|
static
|
mergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema)
Merges the message (delimited) from the InputStream
using the given schema. |
|
static
|
mergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema,
LinkedBuffer buffer)
Merges the message (delimited) from the InputStream
using the given schema. |
|
static
|
mergeFrom(byte[] data,
int offset,
int length,
T message,
Schema<T> schema)
Merges the message with the byte array using the given schema. |
|
static
|
mergeFrom(byte[] data,
T message,
Schema<T> schema)
Merges the message with the byte array using the given schema. |
|
static
|
mergeFrom(java.io.InputStream in,
T message,
Schema<T> schema)
Merges the message from the InputStream using
the given schema. |
|
static
|
mergeFrom(java.io.InputStream in,
T message,
Schema<T> schema,
LinkedBuffer buffer)
Merges the message from the InputStream using
the given schema. |
|
static Pipe |
newPipe(byte[] data)
Creates a protobuf pipe from a byte array. |
|
static Pipe |
newPipe(byte[] data,
int offset,
int len)
Creates a protobuf pipe from a byte array. |
|
static Pipe |
newPipe(java.io.InputStream in)
Creates a protobuf pipe from an InputStream. |
|
static
|
optMergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema,
boolean drainRemainingBytesIfTooLarge,
LinkedBuffer buffer)
Optimal/Optional mergeDelimitedFrom - If the message does not fit the buffer, no merge is done and this method will return false. |
|
static
|
optMergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema,
LinkedBuffer buffer)
Optimal/Optional mergeDelimitedFrom - If the message does not fit the buffer, no merge is done and this method will return false. |
|
static
|
optWriteDelimitedTo(java.io.OutputStream out,
T message,
Schema<T> schema,
LinkedBuffer buffer)
Optimal writeDelimitedTo - The varint32 prefix is written to the buffer instead of directly writing to outputstream. |
|
static
|
parseListFrom(java.io.InputStream in,
Schema<T> schema)
Parses the messages (delimited) from the InputStream
using the given schema. |
|
static
|
toByteArray(T message,
Schema<T> schema,
LinkedBuffer buffer)
Serializes the message into a byte array using the given schema. |
|
static
|
writeDelimitedTo(java.io.DataOutput out,
T message,
Schema<T> schema)
Used by the code generated messages that implement Externalizable. |
|
static
|
writeDelimitedTo(java.io.OutputStream out,
T message,
Schema<T> schema,
LinkedBuffer buffer)
Serializes the message, prefixed with its length, into an
OutputStream. |
|
static
|
writeListTo(java.io.OutputStream out,
java.util.List<T> messages,
Schema<T> schema,
LinkedBuffer buffer)
Serializes the messages (delimited) into an OutputStream
using the given schema. |
|
static
|
writeTo(LinkedBuffer buffer,
T message,
Schema<T> schema)
Writes the message into the LinkedBuffer using the given schema. |
|
static
|
writeTo(java.io.OutputStream out,
T message,
Schema<T> schema,
LinkedBuffer buffer)
Serializes the message into an OutputStream using the given schema. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Pipe newPipe(byte[] data)
public static Pipe newPipe(byte[] data,
int offset,
int len)
public static Pipe newPipe(java.io.InputStream in)
InputStream.
public static <T> void mergeFrom(byte[] data,
T message,
Schema<T> schema)
message with the byte array using the given schema.
public static <T> void mergeFrom(byte[] data,
int offset,
int length,
T message,
Schema<T> schema)
message with the byte array using the given schema.
public static <T> void mergeFrom(java.io.InputStream in,
T message,
Schema<T> schema)
throws java.io.IOException
message from the InputStream using
the given schema.
java.io.IOException
public static <T> void mergeFrom(java.io.InputStream in,
T message,
Schema<T> schema,
LinkedBuffer buffer)
throws java.io.IOException
message from the InputStream using
the given schema.
The buffer's internal byte array will be used for reading the message.
java.io.IOException
public static <T> int mergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema)
throws java.io.IOException
message (delimited) from the InputStream
using the given schema.
java.io.IOException
public static <T> int mergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema,
LinkedBuffer buffer)
throws java.io.IOException
message (delimited) from the InputStream
using the given schema.
The delimited message size must not be larger than the
buffer's size/capacity.
ProtobufException "size limit exceeded" is thrown otherwise.
java.io.IOException
public static <T> int mergeDelimitedFrom(java.io.DataInput in,
T message,
Schema<T> schema)
throws java.io.IOException
Externalizable.
Merges from the DataInput.
java.io.IOException
public static <T> byte[] toByteArray(T message,
Schema<T> schema,
LinkedBuffer buffer)
message into a byte array using the given schema.
public static <T> int writeTo(LinkedBuffer buffer,
T message,
Schema<T> schema)
message into the LinkedBuffer using the given schema.
public static <T> int writeTo(java.io.OutputStream out,
T message,
Schema<T> schema,
LinkedBuffer buffer)
throws java.io.IOException
message into an OutputStream using the given schema.
java.io.IOException
public static <T> int writeDelimitedTo(java.io.OutputStream out,
T message,
Schema<T> schema,
LinkedBuffer buffer)
throws java.io.IOException
message, prefixed with its length, into an
OutputStream.
java.io.IOException
public static <T> int writeDelimitedTo(java.io.DataOutput out,
T message,
Schema<T> schema)
throws java.io.IOException
Externalizable.
Writes to the DataOutput.
java.io.IOException
public static <T> int writeListTo(java.io.OutputStream out,
java.util.List<T> messages,
Schema<T> schema,
LinkedBuffer buffer)
throws java.io.IOException
messages (delimited) into an OutputStream
using the given schema.
java.io.IOException
public static <T> java.util.List<T> parseListFrom(java.io.InputStream in,
Schema<T> schema)
throws java.io.IOException
messages (delimited) from the InputStream
using the given schema.
java.io.IOException
public static <T> boolean optMergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema,
LinkedBuffer buffer)
throws java.io.IOException
java.io.IOException
public static <T> boolean optMergeDelimitedFrom(java.io.InputStream in,
T message,
Schema<T> schema,
boolean drainRemainingBytesIfTooLarge,
LinkedBuffer buffer)
throws java.io.IOException
java.io.IOException
public static <T> int optWriteDelimitedTo(java.io.OutputStream out,
T message,
Schema<T> schema,
LinkedBuffer buffer)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||