public int GetInt32() { if (ReadBytes + sizeof(int) > WrittenBytes) throw new AegisException(AegisResult.BufferUnderflow, "No more readable buffer."); var val = BitConverter.ToInt32(Buffer, ReadBytes); ReadBytes += sizeof(int); return val; }