Auxiliary function to read numeric data
@ignore
@param {number} size - Size of the element to read
@param {function} bufferReader - Function to read next value
@return {Array<number>|number}
15883
function readNumber(size, bufferReader) {
  if (size !== 1) {
    var numbers = new Array(size);
    for (var i = 0; i < size; i++) {
      numbers[i] = bufferReader();
    }
    return numbers;
  } else {
    return bufferReader();
  }
}
101857
def peek(self, size):
        
        c = self.read(size)
        self._buffer = self._buffer + c
        return c
649271
def readline(self, size=-1):
        
        remainder = int(self.length) - self.__position
        if size < 0 or size > remainder:
            size = remainder

        if size == 0:
            return EMPTY

        received = 0
        data = StringIO()
        while received < size:
            chunk_data = self.readchunk()
            pos = chunk_data.find(NEWLN, 0, size)
            if pos != -1:
                size = received + pos + 1

            received += len(chunk_data)
            data.write(chunk_data)
            if pos != -1:
                break

        self.__position -= received - size

        # Return 'size' bytes and store the rest.
        data.seek(size)
        self.__buffer = data.read()
        data.seek(0)
        return data.read(size)
261619
def __read(self, size):
        
        c = len(self.buf)
        while c < size:
            buf = self.fileobj.read(self.bufsize)
            if not buf:
                break
            self.buf += buf
            c += len(buf)
        buf = self.buf[:size]
        self.buf = self.buf[size:]
        return buf
430766
private static int readLen(ByteBuffer buffer) {
        int len = 0;
        int i = Buffers.readUByte(buffer);
        if ((i & 0x80) != 0) {
            //read one more byte.
            len |= (i & 0x7f) << 8;
            len += Buffers.readUByte(buffer);
        } else {
            len = i;
        }
        return len;
    }
1177814
def _read_stream_for_size(stream, buf_size=65536):
    """"""
    size = 0
    while True:
        buf = stream.read(buf_size)
        size += len(buf)
        if not buf:
            break
    return size
243717
function parse(size) {
  var matches = size.match(regexp);

  if (!matches)
    return null;

  var multiplicator = matches[3] ? +matches[3].replace(/x$/, '') : 1;

  return {
    width: +matches[1] * multiplicator,
    height: +matches[2] * multiplicator
  };
}
86630
function read(idx, size) {
			var mv = II ? 0 : -8 * (size - 1), sum = 0, i;

			for (i = 0; i < size; i++) {
				sum |= (bin.charCodeAt(idx + i) << Math.abs(mv + i*8));
			}

			return sum;
		}
1061049
function readType(buffer, type, size) {
  switch (type) {
    case types.BYTE:
      return buffer.readBytes(size);
    case types.CHAR:
      return trimNull(buffer.readChars(size));
    case types.SHORT:
      return readNumber(size, buffer.readInt16.bind(buffer));
    case types.INT:
      return readNumber(size, buffer.readInt32.bind(buffer));
    case types.FLOAT:
      return readNumber(size, buffer.readFloat32.bind(buffer));
    case types.DOUBLE:
      return readNumber(size, buffer.readFloat64.bind(buffer));
      /* istanbul ignore next */
    default:
      notNetcdf(true, `non valid type ${type}`);
      return undefined;
  }
}
1178878
function _read(size) {
  /* jshint validthis: true */
  if (this.finished) {
    this.push(null);
  } else {
    if (!this.reading) {
      this.reading = true;
      var context = {
        stream: this
      };
      this.call.recvMessageWithContext(context);
    }
  }
}
926040
function BufferStreamReader (data, options) {
  if (!(this instanceof BufferStreamReader)) {
    return new BufferStreamReader(data);
  }

  if (!options) {
    options = {};
  }

  stream.Readable.call(this, options);

  this._data = null;
  this._chunkSize = options.chunkSize || -1;

  if (typeof data === 'string') {
    this._data = new Buffer(data, options.encoding || 'utf8');
  } else if (Buffer.isBuffer(data)) {
    this._data = data;
  }
}
281688
protected byte[] getBuffer(int size) {
    byte[] buffer;
    if (size > SERIALIZER_BUFFER_SIZE) {
      buffer = new byte[size];
    } else {
      buffer = serializerBuffers.get();
      serializerBuffers.remove();
    }
    return buffer;
  }
203152
def _read_protos(self, size):
        
        _byte = self._read_unpack(size)
        _prot = ETHERTYPE.get(_byte)
        return _prot
1338834
function(size) {
        var result = 0,
            i;
        this.checkOffset(size);
        for (i = this.index + size - 1; i >= this.index; i--) {
            result = (result << 8) + this.byteAt(i);
        }
        this.index += size;
        return result;
    }
281345
def read(self, size=-1):
        
        logger.debug("reading with size: %d", size)
        if self.response is None:
            return b''

        if size == 0:
            return b''
        elif size < 0 and len(self._read_buffer) == 0:
            retval = self.response.raw.read()
        elif size < 0:
            retval = self._read_buffer.read() + self.response.raw.read()
        else:
            while len(self._read_buffer) < size:
                logger.debug("http reading more content at current_pos: %d with size: %d", self._current_pos, size)
                bytes_read = self._read_buffer.fill(self._read_iter)
                if bytes_read == 0:
                    # Oops, ran out of data early.
                    retval = self._read_buffer.read()
                    self._current_pos += len(retval)

                    return retval

            # If we got here, it means we have enough data in the buffer
            # to return to the caller.
            retval = self._read_buffer.read(size)

        self._current_pos += len(retval)
        return retval
140785
def read(self, size):
        
        # If enabled tell the server that our buffer can fit the whole
        # stream, this often increases throughput alot.
        if self._update_buffer and not self._updated_buffer and self.duration:
            self.update_buffer((self.duration * 1000) + 5000)
            self._updated_buffer = True

        if not self._buf or len(self._buf) != size:
            self._buf = ffi.new("char[]", size)
            self._view = ffi.buffer(self._buf, size)

        res = librtmp.RTMP_Read(self.client.rtmp, self._buf, size)

        if res < 0:
            raise IOError("Failed to read data")

        return self._view[:res]
212822
function readNumber(walker) {
    var match = walker.match(/\s*(-?[0-9]+(\.[0-9]+)?)/g, 1);

    if (match) {
        return {
            type: ExprType.NUMBER,
            value: +match[1]
        };
    }
    else if (walker.currentCode() === 45) {
        walker.go(1);
        return {
            type: ExprType.UNARY,
            expr: readUnaryExpr(walker),
            operator: 45
        };
    }
}