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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isLast
(int header) static int
length
(int header) static byte[]
pack
(int length, boolean hasMore) static int
parse
(byte[] buf) static int
parse
(byte[] buf, int pos) static int
parse
(int b1, int b2) static int
peek
(ByteBuffer buf) static int
peek
(ByteBuffer buf, int pos) static int
read
(ByteBuffer buf) static void
write
(ByteBuffer buf, int length, boolean hasMore) static void
write
(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)
-