public class DataBlock extends Object
Constructor and Description |
---|
DataBlock()
Create a simple and empty DataBlock
|
Modifier and Type | Method and Description |
---|---|
void |
addOffset(int offset)
Increase the offset position
|
void |
clear()
Clear the object
|
io.netty.buffer.ByteBuf |
getBlock()
Deprecated.
method, prefer getByteBlock()
|
byte[] |
getByteBlock() |
int |
getByteCount() |
byte |
getByteCountLower() |
byte |
getByteCountUpper() |
byte[] |
getByteMarkers() |
byte |
getDescriptor() |
int[] |
getMarkers() |
int |
getOffset() |
boolean |
isCleared()
Is this Block cleared
|
boolean |
isEOF() |
boolean |
isEOR() |
boolean |
isERROR() |
boolean |
isRESTART() |
void |
setBlock(byte[] block)
Set the block and the byte count according to the block
|
void |
setBlock(byte[] block,
int size)
Set the block and the byte count
|
void |
setBlock(io.netty.buffer.ByteBuf block)
Set the block and the byte count according to the block
|
void |
setByteCount(byte upper,
byte lower) |
void |
setByteCount(int byteCount) |
void |
setDescriptor(int descriptor) |
void |
setEOF(boolean isEOF) |
void |
setEOR(boolean isEOR) |
void |
setERROR(boolean isERROR) |
void |
setMarkers(int[] markers)
Set the markers and the byte count
|
void |
setRESTART(boolean isRESTART) |
static String |
toBinaryString(byte[] bytes,
boolean cutted)
Translate the given array of byte into a string in binary format
|
String |
toString() |
@Deprecated public final io.netty.buffer.ByteBuf getBlock()
public final byte[] getByteBlock()
public final int getOffset()
public final void addOffset(int offset)
offset
- public final void setBlock(io.netty.buffer.ByteBuf block)
block
- the block to setpublic final void setBlock(byte[] block)
block
- the block to setpublic final void setBlock(byte[] block, int size)
block
- the block to setsize
- the real size to setpublic final int getByteCount()
public final void setByteCount(int byteCount)
byteCount
- the byteCount to setpublic final void setByteCount(byte upper, byte lower)
upper
- upper byte of the 2 bytes lengthlower
- lower byte of the 2 bytes lengthpublic final byte getByteCountUpper()
public final byte getByteCountLower()
public final byte getDescriptor()
public final void setDescriptor(int descriptor)
descriptor
- the descriptor to setpublic final boolean isEOF()
public final void setEOF(boolean isEOF)
isEOF
- the isEOF to setpublic final boolean isEOR()
public final void setEOR(boolean isEOR)
isEOR
- the isEOR to setpublic final boolean isERROR()
public final void setERROR(boolean isERROR)
isERROR
- the isERROR to setpublic final boolean isRESTART()
public final void setRESTART(boolean isRESTART)
isRESTART
- the isRESTART to setpublic final int[] getMarkers()
public final byte[] getByteMarkers()
public final void setMarkers(int[] markers)
markers
- the markers to setpublic final void clear()
public final boolean isCleared()
public static String toBinaryString(byte[] bytes, boolean cutted)
bytes
- cutted
- True if each Byte should be 'blank' separated or
notCopyright © 2009–2022 Waarp. All rights reserved.