コード例 #1
0
        public MessagePackByteArrayPacker(byte[] buffer, int startOffset, ByteBufferAllocator allocator, PackerCompatibilityOptions compatibilityOptions)
            : base(compatibilityOptions)
        {
            this._buffer = buffer ?? Binary.Empty;
            if (startOffset < 0)
            {
                throw new ArgumentOutOfRangeException("startOffset");
            }

            if (startOffset > this._buffer.Length)
            {
                throw new ArgumentException("The startOffset is too large or the length of buffer is too small.");
            }

            this._initialOffset = startOffset;
            this._offset        = startOffset;
            this._allocator     = allocator;
        }
コード例 #2
0
 public MessagePackByteArrayPacker(byte[] buffer, ByteBufferAllocator allocator, PackerCompatibilityOptions compatibilityOptions)
     : this(buffer, 0, allocator, compatibilityOptions)
 {
 }