Package hudson.remoting
Class ChunkHeader
- java.lang.Object
-
- hudson.remoting.ChunkHeader
-
public class ChunkHeader extends Object
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 Modifier and Type Field Description static int
SIZE
-
Constructor Summary
Constructors Constructor Description ChunkHeader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
SIZE
public static final int SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public static int read(ByteBuffer buf)
-
peek
public static int peek(ByteBuffer buf)
-
peek
public static int peek(ByteBuffer buf, int pos)
-
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
public static void write(ByteBuffer buf, int length, boolean hasMore)
-
write
public static void write(ByteBufferQueue buf, int length, boolean hasMore)
-
pack
public static byte[] pack(int length, boolean hasMore)
-
-