Returns an immediate event_transition to read a specified number of bytes.
195140
def read_data_transition(self, length, whence=None,
                             skip=False, stream_event=ION_STREAM_INCOMPLETE_EVENT):
        """"""
        if whence is None:
            whence = self.whence

        return Transition(
            None, _read_data_handler(length, whence, self, skip, stream_event)
        )
708398
function _read(size) {
  /* jshint validthis: true */
  var self = this;
  /**
   * Callback to be called when a READ event is received. Pushes the data onto
   * the read queue and starts reading again if applicable
   * @param {grpc.Event} event READ event object
   */
  function readCallback(err, event) {
    if (err) {
      self.terminate();
      return;
    }
    if (self.finished) {
      self.push(null);
      return;
    }
    var data = event.read;
    var deserialized;
    try {
      deserialized = self.deserialize(data);
    } catch (e) {
      e.code = constants.status.INTERNAL;
      self.emit('error', e);
      return;
    }
    if (self.push(deserialized) && data !== null) {
      var read_batch = {};
      read_batch[grpc.opType.RECV_MESSAGE] = true;
      self.call.startBatch(read_batch, readCallback);
    } else {
      self.reading = false;
    }
  }
  if (self.finished) {
    self.push(null);
  } else {
    if (!self.reading) {
      self.reading = true;
      var batch = {};
      batch[grpc.opType.RECV_MESSAGE] = true;
      self.call.startBatch(batch, readCallback);
    }
  }
}
500353
def _from_bytes(bytes, byteorder="big", signed=False):
    """"""
    return int.from_bytes(bytes, byteorder=byteorder, signed=signed)
592079
def read(self, b=-1):
        
        # Any negative value for b is interpreted as a full read
        # None is also accepted for legacy compatibility
        if b is None or b < 0:
            b = -1

        _LOGGER.debug("Stream read called, requesting %d bytes", b)
        output = io.BytesIO()

        if not self._message_prepped:
            self._prep_message()

        if self.closed:
            raise ValueError("I/O operation on closed file")

        if b >= 0:
            self._read_bytes(b)
            output.write(self.output_buffer[:b])
            self.output_buffer = self.output_buffer[b:]
        else:
            while True:
                line = self.readline()
                if not line:
                    break
                output.write(line)

        self.bytes_read += output.tell()
        _LOGGER.debug("Returning %d bytes of %d bytes requested", output.tell(), b)
        return output.getvalue()
1310099
async def read(self, n=None):
        
        if self._streamed:
            return b''
        buffer = []
        async for body in self:
            buffer.append(body)
        return b''.join(buffer)
795526
def read(self, b=-1):
        
        remaining_bytes = b
        data = io.BytesIO()
        while True:
            try:
                chunk = to_bytes(self.__wrapped__.read(remaining_bytes))
            except ValueError:
                if self.__wrapped__.closed:
                    break
                raise

            if not chunk:
                break

            data.write(chunk)
            remaining_bytes -= len(chunk)

            if remaining_bytes <= 0:
                break
        return data.getvalue()
1120543
def _struct_or_lob_handler(c, ctx):
    """"""
    assert c == _OPEN_BRACE
    c, self = yield
    yield ctx.immediate_transition(_STRUCT_OR_LOB_TABLE[c](c, ctx))
303814
def peek(self, n=1):
        """"""
        if n > len(self._readbuffer) - self._offset:
            chunk = self.read(n)
            self._offset -= len(chunk)

        # Return up to 512 bytes to reduce allocation overhead for tight loops.
        return self._readbuffer[self._offset: self._offset + 512]
1315589
def _readbin(self, length, start):
        """"""
        if not length:
            return ''
        # Get the byte slice containing our bit slice
        startbyte, startoffset = divmod(start + self._offset, 8)
        endbyte = (start + self._offset + length - 1) // 8
        b = self._datastore.getbyteslice(startbyte, endbyte + 1)
        # Convert to a string of '0' and '1's (via a hex string an and int!)
        try:
            c = "{:0{}b}".format(int(binascii.hexlify(b), 16), 8*len(b))
        except TypeError:
            # Hack to get Python 2.6 working
            c = "{0:0{1}b}".format(int(binascii.hexlify(str(b)), 16), 8*len(b))
        # Finally chop off any extra bits.
        return c[startoffset:startoffset + length]
148667
public int read(byte[] b, int off, int len) throws IOException
    {
        if (_expectContinues!=null)
            expectContinues();
        return super.read(b, off, len);
    }
666809
def peek(self, n=1):
        """"""
        if n > len(self._readbuffer) - self._offset:
            chunk = self.read(n)
            if len(chunk) > self._offset:
                self._readbuffer = chunk + self._readbuffer[self._offset:]
                self._offset = 0
            else:
                self._offset -= len(chunk)

        # Return up to 512 bytes to reduce allocation overhead for tight loops.
        return self._readbuffer[self._offset: self._offset + 512]
1351982
def _get_event(event_file_name):
    

    if event_file_name == STDIN_FILE_NAME:
        # If event is empty, listen to stdin for event data until EOF
        LOG.info("Reading invoke payload from stdin (you can also pass it from file with --event)")

    # click.open_file knows to open stdin when filename is '-'. This is safer than manually opening streams, and
    # accidentally closing a standard stream
    with click.open_file(event_file_name, 'r') as fp:
        return fp.read()
605315
def read(self, size=-1):
        """"""
        self._check_not_closed()
        if self.state == "EOF" or size == 0:
            return b""
        elif size < 0:
            return self._read_all()
        else:
            return self._read_block(size)
269664
public int read(byte[] b, int off, int len) throws IOException {

    if (currentOffset >= dataLength) {
      return -1;
    }
    
    return doRead(b,off,len);
  }
314168
def get_transition(self,  # suppress(too-many-arguments)
                       line,
                       line_index,
                       column,
                       is_escaped,
                       comment_system_transitions,
                       eof=False):
        """"""
        del comment_system_transitions

        if (_token_at_col_in_line(line,
                                  column,
                                  "```",
                                  3) and
                not _is_escaped(line, column, is_escaped)):
            # Hit a disable token, so resume the last parser
            return (DisabledParser((line_index, column + 3),
                                   self.__class__,
                                   self._waiting_until), 3, self._started_at)
        elif self._waiting_until != ParserState.EOL:
            wait_until_len = len(self._waiting_until)
            if (_token_at_col_in_line(line,
                                      column,
                                      self._waiting_until,
                                      wait_until_len) and
                    not _is_escaped(line, column, is_escaped)):

                # Skip ahead to end of this token
                return (InTextParser(),
                        len(self._waiting_until),
                        self._started_at)
        elif self._waiting_until == ParserState.EOL and column == 0:
            # We hit a new line and the state ends here. Return
            # corresponding state
            return (InTextParser(), 0, self._started_at)
        elif eof:
            # We hit the end of the file and were still in a comment
            # state. Grab everything up to here.
            return (InTextParser(), 0, self._started_at)

        # Move ahead by one character otherwise
        return (self, 1, None)
102925
def read(self, size=-1):
        """"""
        if size == 0:
            return b''
        elif size < 0:
            from_buf = self._read_from_buffer()
            self._current_pos = self._content_length
            return from_buf + self._raw_reader.read()

        #
        # Return unused data first
        #
        if len(self._buffer) >= size:
            return self._read_from_buffer(size)

        #
        # If the stream is finished, return what we have.
        #
        if self._eof:
            return self._read_from_buffer()

        #
        # Fill our buffer to the required size.
        #
        # logger.debug('filling %r byte-long buffer up to %r bytes', len(self._buffer), size)
        self._fill_buffer(size)
        return self._read_from_buffer(size)
253891
def read(self, size=-1):
        """"""
        if self.connected is None:
            return None

        # Extract requested amount of data from the read buffer.
        data = self._get_input(size)

        return data