@ThreadSafe public final class ProtoBufJournalFormatter extends Object implements JournalFormatter
AbstractMessageLite.writeDelimitedTo(OutputStream)
and Journal.JournalEntry.parseDelimitedFrom(InputStream)
. This class is thread-safe.JournalFormatter.Factory
Constructor and Description |
---|
ProtoBufJournalFormatter()
Constructs a new
ProtoBufJournalFormatter . |
Modifier and Type | Method and Description |
---|---|
JournalInputStream |
deserialize(InputStream inputStream)
Returns a
JournalInputStream from the given input stream. |
void |
serialize(Journal.JournalEntry entry,
OutputStream outputStream)
Serializes the given entry and writes it to the given output stream.
|
public ProtoBufJournalFormatter()
ProtoBufJournalFormatter
.public void serialize(Journal.JournalEntry entry, OutputStream outputStream) throws IOException
JournalFormatter
serialize
in interface JournalFormatter
entry
- The journal entry to serializeoutputStream
- the output stream to serialize the entry toIOException
public JournalInputStream deserialize(InputStream inputStream) throws IOException
JournalFormatter
JournalInputStream
from the given input stream. The returned input stream
produces a stream of Journal.JournalEntry
objects.deserialize
in interface JournalFormatter
inputStream
- The input stream to deserializeJournalInputStream
for reading all the journal entries in the given input
stream.IOException
Copyright © 2023. All Rights Reserved.