public class MessageStreams extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
READABLE_ENTRY_SEP |
| Constructor and Description |
|---|
MessageStreams() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends PMessage<T>,F extends PField> |
file(File file,
Serializer serializer,
PStructDescriptor<T,F> descriptor)
Read a file containing entries of a given type.
|
static <T extends PMessage<T>,F extends PField> |
resource(String resource,
Serializer serializer,
PStructDescriptor<T,F> descriptor)
Read a file containing entries of a given type.
|
static <T extends PMessage<T>,F extends PField> |
stream(InputStream in,
Serializer serializer,
PStructDescriptor<T,F> descriptor)
Read a input stream containing entries of a given type.
|
public static <T extends PMessage<T>,F extends PField> Stream<T> file(File file, Serializer serializer, PStructDescriptor<T,F> descriptor) throws IOException
T - The message type.F - The message field type.file - The file to read.serializer - The serializer to use.descriptor - The descriptor of the entry type of the file.IOException - when unable to open the stream.public static <T extends PMessage<T>,F extends PField> Stream<T> resource(String resource, Serializer serializer, PStructDescriptor<T,F> descriptor) throws IOException
T - The message type.F - The message field type.resource - The file to read.serializer - The serializer to use.descriptor - The descriptor of the entry type of the file.IOException - when unable to open the stream.public static <T extends PMessage<T>,F extends PField> Stream<T> stream(InputStream in, Serializer serializer, PStructDescriptor<T,F> descriptor) throws IOException
T - The message type.F - The message field type.in - The input stream to read.serializer - The serializer to use.descriptor - The descriptor of the entry type of the file.IOException - when unable to open the stream.Copyright © 2016. All rights reserved.