Ejemplo n.º 1
0
Archivo: response.cs Proyecto: fdsc/old
        public long RemoveBlockAt(int position)
        {
            if (count == 0 || position < 0 || position >= bytes.Count)
            {
                return(0);
            }

            long removedLength = bytes[position].LongLength;
            var  tmp           = bytes[position];

            bytes.RemoveAt(position);
            BytesBuilder.BytesToNull(tmp);

            count -= removedLength;
            return(removedLength);
        }
Ejemplo n.º 2
0
Archivo: response.cs Proyecto: fdsc/old
        public long RemoveLastBlock()
        {
            if (count == 0)
            {
                return(0);
            }

            long removedLength = bytes[bytes.Count - 1].LongLength;
            var  tmp           = bytes[bytes.Count - 1];

            bytes.RemoveAt(bytes.Count - 1);
            BytesBuilder.BytesToNull(tmp);

            count -= removedLength;
            return(removedLength);
        }
Ejemplo n.º 3
0
Archivo: response.cs Proyecto: fdsc/old
        public long RemoveBlocks(int position, int endPosition)
        {
            if (count == 0 || position < 0 || position >= bytes.Count || position > endPosition || endPosition >= bytes.Count)
            {
                return(0);
            }

            long removedLength = 0;

            for (int i = position; i <= endPosition; i++)
            {
                var tmp = bytes[position];
                removedLength += RemoveBlockAt(position);
                BytesBuilder.BytesToNull(tmp);
            }

            return(removedLength);
        }