public abstract class Frame extends Object
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
contents
The contents.
|
protected FrameHeader |
header
The header.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Frame()
Instantiates a new frame.
|
protected |
Frame(FrameHeader header,
byte[] contents)
Instantiates a new frame.
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
getContents()
Gets the raw contents.
|
long |
getContentsLength()
Gets the contents length.
|
FrameHeader |
getHeader()
Gets the header.
|
void |
readContents(byte[] buf)
Gets the raw contents.
|
void |
readContents(byte[] buf,
int offset,
int length)
Gets the raw contents.
|
protected void |
setContents(byte[] contents)
Sets the contents.
|
protected void |
setHeader(FrameHeader header)
Sets the header.
|
abstract ByteBuffer |
toByteBuffer()
convert frame to byte buffer.
|
protected FrameHeader header
protected byte[] contents
protected Frame()
protected Frame(FrameHeader header, byte[] contents)
header - the headercontents - the contentspublic long getContentsLength()
public FrameHeader getHeader()
public abstract ByteBuffer toByteBuffer()
public ByteBuffer getContents()
public void readContents(byte[] buf)
public void readContents(byte[] buf,
int offset,
int length)
protected void setHeader(FrameHeader header)
header - the new headerprotected void setContents(byte[] contents)
contents - the new contentsCopyright © 2021. All rights reserved.