private byte ParseByte(byte[] data, ref int index)
{
// if input data is null
if (null == data)
{
throw new FormatException(ConstValue.ERROR_MESSAGE_DATA_NULL_REF);
}
// if index is out of range
if (index < 0 || index >= data.Length)
{
throw new FormatException(ConstValue.ERROR_MESSAGE_DATA_INDEX_OUT_OF_RANGE);
}
// get a byte
byte b = data[index];
// update parser index
++index;
return b;
}