Modifier and Type | Method and Description |
---|---|
static ObjectId |
read(InputStream in)
Read a possibly null
ObjectId from the stream. |
static ObjectId |
readWithoutMarker(InputStream in)
Read a non-null
ObjectId from the stream. |
static void |
write(OutputStream out,
AnyObjectId id)
Write a possibly null
ObjectId to the stream, using markers to
differentiate null and non-null instances. |
static void |
writeWithoutMarker(OutputStream out,
AnyObjectId id)
Write a non-null
ObjectId to the stream. |
public static void write(OutputStream out, @Nullable AnyObjectId id) throws IOException
ObjectId
to the stream, using markers to
differentiate null and non-null instances.
If the id is non-null, writes a NON_NULL_MARKER
followed by the
id's words. If it is null, writes a NULL_MARKER
and nothing
else.
out
- the output streamid
- the object id to serialize; may be nullIOException
- the stream writing failedpublic static void writeWithoutMarker(OutputStream out, @NonNull AnyObjectId id) throws IOException
ObjectId
to the stream.out
- the output streamid
- the object id to serialize; never nullIOException
- the stream writing failed@Nullable public static ObjectId read(InputStream in) throws IOException
ObjectId
from the stream.
Reads the first byte of the stream, which is expected to be either
NON_NULL_MARKER
or NULL_MARKER
.in
- the input streamIOException
- there was an error reading the stream@NonNull public static ObjectId readWithoutMarker(InputStream in) throws IOException
ObjectId
from the stream.in
- the input streamIOException
- there was an error reading the streamCopyright © 2020 Eclipse JGit Project. All rights reserved.