Overrides update to concatenate streamed data up to defined length.
4560
def update(self, **kwargs):
        
        data = kwargs.get('data')
        if data is not None:
            if (util.pd and isinstance(data, util.pd.DataFrame) and
                list(data.columns) != list(self.data.columns) and self._index):
                data = data.reset_index()
            self.verify(data)
            kwargs['data'] = self._concat(data)
            self._count += 1
        super(Buffer, self).update(**kwargs)
103066
public void addReplace(int oldLength, int newLength) {
        if(oldLength == newLength && 0 < oldLength && oldLength <= MAX_SHORT_WIDTH) {
            // Replacement of short oldLength text units by same-length new text.
            // Merge into previous short-replacement record, if any.
            int last = lastUnit();
            if(MAX_UNCHANGED < last && last < MAX_SHORT_CHANGE &&
                    (last >> 12) == oldLength && (last & 0xfff) < MAX_SHORT_CHANGE_LENGTH) {
                setLastUnit(last + 1);
                return;
            }
            append(oldLength << 12);
            return;
        }

        if(oldLength < 0 || newLength < 0) {
            throw new IllegalArgumentException(
                    "addReplace(" + oldLength + ", " + newLength +
                    "): both lengths must be non-negative");
        }
        if (oldLength == 0 && newLength == 0) {
            return;
        }
        int newDelta = newLength - oldLength;
        if (newDelta != 0) {
            if ((newDelta > 0 && delta >= 0 && newDelta > (Integer.MAX_VALUE - delta)) ||
                    (newDelta < 0 && delta < 0 && newDelta < (Integer.MIN_VALUE - delta))) {
                // Integer overflow or underflow.
                throw new IndexOutOfBoundsException();
            }
            delta += newDelta;
        }

        int head = 0x7000;
        if (oldLength < LENGTH_IN_1TRAIL && newLength < LENGTH_IN_1TRAIL) {
            head |= oldLength << 6;
            head |= newLength;
            append(head);
        } else if ((array.length - length) >= 5 || growArray()) {
            int limit = length + 1;
            if(oldLength < LENGTH_IN_1TRAIL) {
                head |= oldLength << 6;
            } else if(oldLength <= 0x7fff) {
                head |= LENGTH_IN_1TRAIL << 6;
                array[limit++] = (char)(0x8000 | oldLength);
            } else {
                head |= (LENGTH_IN_2TRAIL + (oldLength >> 30)) << 6;
                array[limit++] = (char)(0x8000 | (oldLength >> 15));
                array[limit++] = (char)(0x8000 | oldLength);
            }
            if(newLength < LENGTH_IN_1TRAIL) {
                head |= newLength;
            } else if(newLength <= 0x7fff) {
                head |= LENGTH_IN_1TRAIL;
                array[limit++] = (char)(0x8000 | newLength);
            } else {
                head |= LENGTH_IN_2TRAIL + (newLength >> 30);
                array[limit++] = (char)(0x8000 | (newLength >> 15));
                array[limit++] = (char)(0x8000 | newLength);
            }
            array[length] = (char)head;
            length = limit;
        }
    }
1319487
def decode(self, data, as_list=False):
        
        return self._concat(self.decode_streaming(data))
776108
def _concat(self, data):
        
        if isinstance(data, np.ndarray):
            data_length = len(data)
            if data_length < self.length:
                prev_chunk = self.data[-(self.length-data_length):]
                data = np.concatenate([prev_chunk, data])
            elif data_length > self.length:
                data = data[-self.length:]
        elif util.pd and isinstance(data, util.pd.DataFrame):
            data_length = len(data)
            if data_length < self.length:
                prev_chunk = self.data.iloc[-(self.length-data_length):]
                data = util.pd.concat([prev_chunk, data])
            elif data_length > self.length:
                data = data.iloc[-self.length:]
        elif isinstance(data, dict) and data:
            data_length = len(list(data.values())[0])
            new_data = {}
            for k, v in data.items():
                if data_length < self.length:
                    prev_chunk = self.data[k][-(self.length-data_length):]
                    new_data[k] = np.concatenate([prev_chunk, v])
                elif data_length > self.length:
                    new_data[k] = v[-self.length:]
                else:
                    new_data[k] = v
            data = new_data
        self._chunk_length = data_length
        return data
728195
def exhaust_stream(f):
    """"""

    def wrapper(self, stream, *args, **kwargs):
        try:
            return f(self, stream, *args, **kwargs)
        finally:
            exhaust = getattr(stream, "exhaust", None)
            if exhaust is not None:
                exhaust()
            else:
                while 1:
                    chunk = stream.read(1024 * 64)
                    if not chunk:
                        break

    return update_wrapper(wrapper, f)
670046
def stream_data(self, ostream):
        """"""
        istream = self.repo.odb.stream(self.binsha)
        stream_copy(istream, ostream)
        return self
422946
@Override
    public void updateAsciiStream(String columnLabel, InputStream x, long length)
            throws SQLException {
        throw SQLError.noSupport();
    }
193406
function concatStreams(array) {
  var concat = new stream.PassThrough();

  function pipe(i) {
    if (i < array.length - 1) {
      array[i].pipe(concat, {end: false});
      array[i].on('end', function () { pipe(i + 1) });
    } else {
      array[i].pipe(concat);
    }
  }
  if (array.length > 0) {
    pipe(0);
  }

  return concat;
}
1083462
function prependLength(data) {
	const lengthAsBytes = buffer.Buffer.alloc(4);

	lengthAsBytes.writeUInt32BE(data.length);

	return buffer.Buffer.concat([lengthAsBytes, data]);
}
1184235
def _update_length(self):
        
        payload = type(self).oxm_value.pack(self.oxm_value)
        self.oxm_length = len(payload)
1097428
def xadd(self, stream, fields, message_id=b'*', max_len=None,
             exact_len=False):
        """"""
        args = []
        if max_len is not None:
            if exact_len:
                args.extend((b'MAXLEN', max_len))
            else:
                args.extend((b'MAXLEN', b'~', max_len))

        args.append(message_id)

        for k, v in fields.items():
            args.extend([k, v])
        return self.execute(b'XADD', stream, *args)
986515
def append(self, *other):
    
    self._data = it.chain(self._data, Stream(*other)._data)
    return self
483315
def on_receive_append_entries(self, data):
        """"""
        if self.storage.term == data['term']:
            self.state.to_follower()
813715
def update(self, of):
        """"""

        # The other values should be set when the file object is created with dataset.bsfile()
        for p in ('mime_type', 'preference', 'state', 'hash', 'modified', 'size', 'contents', 'source_hash', 'data'):
            setattr(self, p, getattr(of, p))

        return self
576432
def batch_update(self, values, w=1):
        
        for x in values:
            self.update(x, w)
        self.compress()
        return
573106
def _update_data_out(self, data, dtype):
        """"""
        try:
            self.data_out.update({dtype: data})
        except AttributeError:
            self.data_out = {dtype: data}
623323
void updateContentSize(long frameLength, boolean last) {
        if(contentLengthRemaining != -1) {
            contentLengthRemaining -= frameLength;
            if(contentLengthRemaining < 0) {
                UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length exceeds content size", streamId, getFramedChannel());
                getFramedChannel().sendRstStream(streamId, Http2Channel.ERROR_PROTOCOL_ERROR);
            } else if(last && contentLengthRemaining != 0) {
                UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length was less than content size", streamId, getFramedChannel());
                getFramedChannel().sendRstStream(streamId, Http2Channel.ERROR_PROTOCOL_ERROR);
            }
        }
    }