public class MetadataBlockHeader extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BLOCK_LENGTH |
static int |
BLOCK_TYPE_LENGTH |
static int |
HEADER_LENGTH |
static Logger |
logger |
Constructor and Description |
---|
MetadataBlockHeader(boolean isLastBlock,
BlockType blockType,
int dataLength)
Construct a new header in order to write metadatablock to file
|
MetadataBlockHeader(long startByte,
ByteBuffer rawdata)
Construct header by reading bytes
|
Modifier and Type | Method and Description |
---|---|
BlockType |
getBlockType() |
byte[] |
getBytes() |
byte[] |
getBytesWithLastBlockFlag() |
byte[] |
getBytesWithoutIsLastBlockFlag() |
int |
getDataLength() |
boolean |
isLastBlock() |
static MetadataBlockHeader |
readHeader(FileChannel fc)
Create header by reading from file
|
String |
toString() |
public static final int BLOCK_TYPE_LENGTH
public static final int BLOCK_LENGTH
public static final int HEADER_LENGTH
public static Logger logger
public MetadataBlockHeader(long startByte, ByteBuffer rawdata) throws CannotReadException
rawdata
- CannotReadException
public MetadataBlockHeader(boolean isLastBlock, BlockType blockType, int dataLength)
isLastBlock
- blockType
- dataLength
- public static MetadataBlockHeader readHeader(FileChannel fc) throws CannotReadException, IOException
fc
- IOException
CannotReadException
public int getDataLength()
public BlockType getBlockType()
public boolean isLastBlock()
public byte[] getBytesWithoutIsLastBlockFlag()
public byte[] getBytesWithLastBlockFlag()
public byte[] getBytes()
Copyright © 2005–2020 jthink.net. All rights reserved.