Package hudson.remoting
Class ChunkHeader
java.lang.Object
hudson.remoting.ChunkHeader
Parsing of the chunk header.
The header is SIZE bytes, in the network order. The first bit designates whether this chunk
is the last chunk (0 if this is the last chunk), and the remaining 15 bits designate the
length of the chunk as unsigned number.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisLast(int header) static intlength(int header) static byte[]pack(int length, boolean hasMore) static intparse(byte[] buf) static intparse(byte[] buf, int pos) static intparse(int b1, int b2) static intpeek(ByteBuffer buf) static intpeek(ByteBuffer buf, int pos) static intread(ByteBuffer buf) static voidwrite(ByteBuffer buf, int length, boolean hasMore) static voidwrite(ByteBufferQueue buf, int length, boolean hasMore)
-
Field Details
-
SIZE
public static final int SIZE- See Also:
-
-
Constructor Details
-
ChunkHeader
public ChunkHeader()
-
-
Method Details
-
read
-
peek
-
peek
-
parse
public static int parse(byte[] buf) -
parse
public static int parse(byte[] buf, int pos) -
parse
public static int parse(int b1, int b2) -
isLast
public static boolean isLast(int header) -
length
public static int length(int header) -
write
-
write
-
pack
public static byte[] pack(int length, boolean hasMore)
-