Example #1
0
        private void ReadHeader(IBufferReader readerBuffer)
        {
            switch (_headerSize)
            {
            case 1:
                _packageLength = readerBuffer.ReadByte();
                break;

            case 2:
                _packageLength = readerBuffer.ReadInt16();
                break;

            case 4:
                _packageLength = readerBuffer.ReadInt32();
                break;

            default:
                ThrowHelper.ThrowLengthFieldConfigErrorException();
                break;
            }
        }