This class is not thread safe and may issue multiple reads to the underlying stream for each method call made.
This class performs no buffering on its own. This makes it suitable to interleave reads performed by this class with reads performed directly against the underlying InputStream.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum | |
| public static class | PacketLineIn.
IOException thrown by read when the configured input limit is exceeded. |
| public static class | PacketLineIn.
Iterator over packet lines. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | DELIM
Magic return from |
| private static final String | END
Magic return from |
| private final InputStream | |
| private long | |
| private final byte[] | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PacketLineIn(InputStream
the input stream to consume. in, long bytes to read from the input; unlimited if set to 0. limit)Create a new packet line reader. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static String | |
| pack-priv void | |
| pack-priv static String | |
| private IOException | |
| private IOException | |
| public static boolean | Returns: true if the given string isDELIM, otherwise false.the string to check s)Check if a string is the delimiter marker. |
| public static boolean | |
| pack-priv static PacketLineIn. | parseACKv2(String
to parse line, MutableObjectId in case of returnedId)ACK_COMMONParses a ACK/NAK line in protocol V2. |
| pack-priv PacketLineIn. | |
| pack-priv int | |
| public String | |
| public String | Returns: the string.END if the string was the magic flush
packet.Read a single UTF-8 encoded string packet from the input stream. |
| public PacketLineIn. |
| DELIM | back to summary |
|---|---|
| private static final String DELIM Magic return from | |
| END | back to summary |
|---|---|
| private static final String END Magic return from | |
| in | back to summary |
|---|---|
| private final InputStream in | |
| limit | back to summary |
|---|---|
| private long limit | |
| lineBuffer | back to summary |
|---|---|
| private final byte[] lineBuffer | |
| log | back to summary |
|---|---|
| private static final Logger log | |
| PacketLineIn | back to summary |
|---|---|
| public PacketLineIn(InputStream in) Create a new packet line reader.
| |
| PacketLineIn | back to summary |
|---|---|
| public PacketLineIn(InputStream in, long limit) Create a new packet line reader.
| |
| delimiter | back to summary |
|---|---|
| pack-priv static String delimiter() Get the delimiter marker. Intended for use only in tests.
| |
| discardUntilEnd | back to summary |
|---|---|
| pack-priv void discardUntilEnd() throws IOException | |
| end | back to summary |
|---|---|
| pack-priv static String end() Get the end marker. Intended for use only in tests.
| |
| invalidHeader | back to summary |
|---|---|
| private IOException invalidHeader() | |
| invalidHeader | back to summary |
|---|---|
| private IOException invalidHeader(Throwable cause) | |
| isDelimiter | back to summary |
|---|---|
| public static boolean isDelimiter(String s) Check if a string is the delimiter marker.
| |
| isEnd | back to summary |
|---|---|
| public static boolean isEnd(String s) Check if a string is the packet end marker.
| |
| parseACKv2 | back to summary |
|---|---|
| pack-priv static PacketLineIn. Parses a ACK/NAK line in protocol V2.
| |
| readACK | back to summary |
|---|---|
| pack-priv PacketLineIn. | |
| readLength | back to summary |
|---|---|
| pack-priv int readLength() throws IOException | |
| readString | back to summary |
|---|---|
| public String readString() throws IOException Read a single UTF-8 encoded string packet from the input stream.
If the string ends with an LF, it will be removed before returning the
value to the caller. If this automatic trimming behavior is not desired,
use
| |
| readStringRaw | back to summary |
|---|---|
| public String readStringRaw() throws IOException Read a single UTF-8 encoded string packet from the input stream.
Unlike
| |
| readStrings | back to summary |
|---|---|
| public PacketLineIn. Get an iterator to read strings from the input stream.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final PacketLineIn. | ACK
ACK |
| public static final PacketLineIn. | ACK_COMMON
ACK + common |
| public static final PacketLineIn. | ACK_CONTINUE
ACK + continue |
| public static final PacketLineIn. | ACK_READY
ACK + ready |
| public static final PacketLineIn. | NAK
NAK |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PacketLineIn. | |
| public static PacketLineIn. |
| ACK | back to summary |
|---|---|
| public static final PacketLineIn. ACK | |
| ACK_COMMON | back to summary |
|---|---|
| public static final PacketLineIn. ACK + common | |
| ACK_CONTINUE | back to summary |
|---|---|
| public static final PacketLineIn. ACK + continue | |
| ACK_READY | back to summary |
|---|---|
| public static final PacketLineIn. ACK + ready | |
| NAK | back to summary |
|---|---|
| public static final PacketLineIn. NAK | |
| AckNackResult | back to summary |
|---|---|
| private AckNackResult() | |
| valueOf | back to summary |
|---|---|
| public static PacketLineIn. | |
| values | back to summary |
|---|---|
| public static PacketLineIn. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| InputOverLimitIOException | back to summary |
|---|---|
| public InputOverLimitIOException() | |
Calls readString() on the PacketLineIn until
END is encountered.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private PacketLineIn |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| current | back to summary |
|---|---|
| private String current | |
| in | back to summary |
|---|---|
| private PacketLineIn in | |
| PacketLineInIterator | back to summary |
|---|---|
| pack-priv PacketLineInIterator(PacketLineIn in) throws IOException | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type | |