public static BytesBuffer Get(int size)
        {
            var buffer = mPool.Get((x) => x.MaxSize >= size);

            if (buffer == null)
            {
                buffer = new BytesBuffer(size < 256 ? 256 : size);
            }
            buffer.Length = size;
            return(buffer);
        }
 public void CopyTo(int sourceIndex, BytesBuffer buffer, int destinationIndex, int length)
 {
     System.Array.Copy(mData, sourceIndex, buffer.mData, destinationIndex, length);
 }
 public void CopyTo(BytesBuffer buffer, int arrayIndex)
 {
     System.Array.Copy(mData, 0, buffer.mData, arrayIndex, Length);
 }
 public static void Release(BytesBuffer buffer)
 {
     mPool.Add(buffer);
 }
 public ByteEnumerator(BytesBuffer buffer)
 {
     this.buffer = buffer;
     ptr         = -1;
 }