public class ChunkHeader extends Object
The header is 2 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.
Constructor and Description |
---|
ChunkHeader() |
Modifier and Type | Method and 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) |
public static int read(ByteBuffer buf)
public static int peek(ByteBuffer buf)
public static int peek(ByteBuffer buf, int pos)
public static int parse(byte[] buf)
public static int parse(byte[] buf, int pos)
public static int parse(int b1, int b2)
public static boolean isLast(int header)
public static int length(int header)
public static void write(ByteBuffer buf, int length, boolean hasMore)
public static void write(ByteBufferQueue buf, int length, boolean hasMore)
public static byte[] pack(int length, boolean hasMore)
Copyright © 2004–2022. All rights reserved.