// Deserialization public SByte Deserialize() { // Read info about storage format ByteStorageFormats format = (ByteStorageFormats)SerializerStorage.ReadStorageFormatId(ByteStorageBase.FormatIdSizeInBits); // Is it default value if (format == ByteStorageFormats.DefaultValue) { return(0); } // Value stored in PackedData byte[] encodedValue = SerializerStorage.ReadPackedData(1); // Return decoded value return((SByte)encodedValue[0]); }
// Constructor that requires config case value public ByteStorageBase(ByteStorageFormats confCase, byte usedConfigBits) : base((byte)confCase, FormatIdSizeInBits, usedConfigBits) { }