public class Segment
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CHECKSUM_SIZE |
static int |
HEADER_SIZE
6 magic bytes 8 timestamp 8 size 20 checksum 64 tag.
|
static int |
LONG_SIZE |
static byte[] |
MAGIC_BYTES_KEY |
static byte[] |
MAGIC_BYTES_PATCH |
static int |
SIZE_ADDRESS |
static int |
TAG_SIZE |
static int |
TYPE_KEY |
static int |
TYPE_PATCH |
| Constructor and Description |
|---|
Segment() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asBytes() |
boolean |
equals(java.lang.Object obj) |
byte[] |
generateChecksum() |
void |
generateFromData() |
long |
getAddress() |
byte[] |
getChecksum() |
byte[] |
getData() |
byte[] |
getHeaderAsBytes() |
static byte[] |
getMagicBytesByType(int type) |
long |
getSize() |
Snapshot |
getSnapshot() |
java.lang.String |
getTag() |
long |
getTimestampSec() |
int |
getType() |
static int |
getTypeByteBytes(byte[] bytes) |
int |
hashCode() |
boolean |
hasTag() |
boolean |
isDataValid() |
void |
setAddress(long address) |
void |
setChecksum(byte[] checksum) |
void |
setData(byte[] data) |
void |
setSize(long size) |
void |
setTag(java.lang.String tag) |
void |
setTimestampSec(long timestampSec) |
void |
setType(int type) |
public static final int SIZE_ADDRESS
public static final int LONG_SIZE
public static final int TAG_SIZE
public static final int CHECKSUM_SIZE
public static final int HEADER_SIZE
public static final int TYPE_KEY
public static final int TYPE_PATCH
public static final byte[] MAGIC_BYTES_KEY
public static final byte[] MAGIC_BYTES_PATCH
public byte[] getData()
public void setData(byte[] data)
public void generateFromData()
public byte[] getChecksum()
public void setChecksum(byte[] checksum)
public long getSize()
public void setSize(long size)
public int getType()
public void setType(int type)
public long getTimestampSec()
public void setTimestampSec(long timestampSec)
public long getAddress()
public void setAddress(long address)
public java.lang.String getTag()
public void setTag(java.lang.String tag)
public boolean hasTag()
public final byte[] generateChecksum()
public boolean isDataValid()
public byte[] asBytes()
public byte[] getHeaderAsBytes()
public static byte[] getMagicBytesByType(int type)
public static int getTypeByteBytes(byte[] bytes)
public Snapshot getSnapshot()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object