Ejemplo n.º 1
0
 /// <summary>
 /// Escreve o buffer no item.
 /// </summary>
 /// <param name="vBuffer">buffer com os dados que serão inseridos.</param>
 /// <param name="srcOffset">Offset da origem dom buffer.</param>
 /// <param name="dstOffset">Offset de destino.</param>
 /// <param name="length">Quantidade de dados que serão escritors</param>
 public void Write(VirtualArray vBuffer, int srcOffset, int dstOffset, int length)
 {
     if (vBuffer != null)
     {
         VirtualArray dst = new VirtualArray(_data);
         VirtualArray.CopyData(vBuffer, new VirtualIndex(srcOffset), dst, new VirtualIndex(dstOffset), length, true);
         _noOfChunks = _data.Count;
     }
 }
Ejemplo n.º 2
0
 public override void Write(VirtualArray vBuffer, int srcOffset, int dstOffset, int length)
 {
     if (vBuffer == null)
     {
         return;
     }
     {
         VirtualArray vDstArray = new VirtualArray(_data);
         VirtualArray.CopyData(vBuffer, new VirtualIndex(srcOffset), vDstArray, new VirtualIndex(dstOffset), length, true);
         _noOfChunks = _data.Count;
     }
 }
Ejemplo n.º 3
0
        public override void Write(VirtualArray vBuffer, int srcOffset, int dstOffset, int length)
        {
            if (vBuffer == null)
            {
                return;
            }

            VirtualArray vDstArray = new VirtualArray(_data);

            VirtualArray.CopyData(vBuffer, new VirtualIndex(srcOffset), vDstArray, new VirtualIndex(dstOffset), length, true);

            _noOfChunks = _data.Count;
            //_lastChunkSize = ((byte[])_data[_data.Count - 1]).Length;
            _lastChunkSize += (length < 0 ? 0 : length) % LARGE_OBJECT_SIZE;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Lê os dados da instancia.
        /// </summary>
        /// <param name="offset"></param>
        /// <param name="length"></param>
        /// <returns></returns>
        public VirtualArray Read(int offset, int length)
        {
            VirtualArray dst = null;
            int          num = this.Length;

            if (offset >= num)
            {
                return(new VirtualArray(0));
            }
            if ((offset + length) > num)
            {
                length -= (offset + length) - num;
            }
            VirtualArray src = new VirtualArray(_data);

            dst = new VirtualArray((long)length);
            VirtualIndex srcIndex = new VirtualIndex(offset);
            VirtualIndex dstIndex = new VirtualIndex();

            VirtualArray.CopyData(src, srcIndex, dst, dstIndex, length);
            return(dst);
        }
Ejemplo n.º 5
0
        public override VirtualArray Read(int offset, int length)
        {
            VirtualArray vBuffer      = null;
            int          streamLength = Length;

            if (offset >= streamLength)
            {
                return(new VirtualArray(0));
            }
            if (offset + length > streamLength)
            {
                length -= (offset + length - streamLength);
            }

            VirtualArray vSrc = new VirtualArray(_data);

            vBuffer = new VirtualArray(length);
            VirtualIndex vSrcIndex = new VirtualIndex(offset);
            VirtualIndex vDstIndex = new VirtualIndex();

            VirtualArray.CopyData(vSrc, vSrcIndex, vBuffer, vDstIndex, length);

            return(vBuffer);
        }