Пример #1
0
        public InsertAction(long p, byte[] d, long index, long length, ByteBuffer bb)
        {
            byteBuf = bb;
            pos     = p;

            // if there is no data to insert
            // don't create a segment
            if (length == 0)
            {
                seg = null;
            }
            else
            {
                SimpleBuffer cb = new SimpleBuffer();
                seg = new Segment(cb, cb.Size, cb.Size + length - 1);
                cb.Append(d, index, length);
            }
        }
Пример #2
0
        public AppendAction(byte[] d, long index, long length, ByteBuffer bb)
        {
            byteBuf = bb;

            // if there is no data to append
            // don't create a segment
            if (d.Length == 0)
            {
                seg = null;
            }
            else
            {
                SimpleBuffer cb = new SimpleBuffer();
                seg = new Segment(cb, cb.Size, cb.Size + length - 1);

                cb.Append(d, index, length);
            }
        }