Reads encoded data from the file-like object.

    Args:
      read_size (int): number of bytes of encoded data to read.

    Returns:
      int: number of bytes of encoded data read.
775719
def _ReadEncodedData(self, read_size):
    
    encoded_data = self._file_object.read(read_size)

    read_count = len(encoded_data)

    self._encoded_data = b''.join([self._encoded_data, encoded_data])

    self._decoded_data, self._encoded_data = (
        self._decoder.Decode(self._encoded_data))

    self._decoded_data_size = len(self._decoded_data)

    return read_count
373168
def read(self, size=1024):
        
        data = self.fileobj.recv(size)
        if not data:
            self.flag_eof = True
            raise EOFError('Pty is closed')

        return self.decoder.decode(data, final=False)
1306239
def _GetDecryptedStreamSize(self):
    
    self._file_object.seek(0, os.SEEK_SET)

    self._decrypter = self._GetDecrypter()
    self._decrypted_data = b''

    encrypted_data_offset = 0
    encrypted_data_size = self._file_object.get_size()
    decrypted_stream_size = 0

    while encrypted_data_offset < encrypted_data_size:
      read_count = self._ReadEncryptedData(self._ENCRYPTED_DATA_BUFFER_SIZE)
      if read_count == 0:
        break

      encrypted_data_offset += read_count
      decrypted_stream_size += self._decrypted_data_size

    return decrypted_stream_size
916873
def read_bytes(self, length) -> bytes:
        
        value = self.stream.read(length)
        return value
331526
def readline(self, size=None):
        
        if size is not None:
            data = self.rfile.readline(size)
            self.bytes_read += len(data)
            self._check_length()
            return data

        # User didn't specify a size ...
        # We read the line in chunks to make sure it's not a 100MB line !
        res = []
        while True:
            data = self.rfile.readline(256)
            self.bytes_read += len(data)
            self._check_length()
            res.append(data)
            # See https://github.com/cherrypy/cherrypy/issues/421
            if len(data) < 256 or data[-1:] == LF:
                return EMPTY.join(res)
350617
def read(self, length):
        
        data = bytearray()
        while len(data) != length:
            data += self.sock.recv((length - len(data)))
            if not data:
                raise ConnectionError('Connection unexpectedly closed.')
        return data
259562
def read(self, chunk_size=None):
        
        if chunk_size:
            data = self.content[self.pos:self.pos + chunk_size]
            self.pos += len(data)
            return data
        else:
            return self.content
582681
def read(self, size = None):
        
        r = self._buffer
        self._buffer = bytes()
        if size is not None:
            size -= len(r)
        r = r + self._response.read(size)
        #raise RuntimeError
        return r
1272042
def readline(self, size=-1):
        
        return self._safe_call(
            True,
            super(SSLFileobjectMixin, self).readline,
            size,
        )
791272
def read1(self, size=-1):
        
        # Usually, read1() calls _fp.read() at most once. However, sometimes
        # this does not give enough data for the decompressor to make progress.
        # In this case we make multiple reads, to avoid returning b"".
        self._check_can_read()
        if size is None:
            #This is not needed on Python 3 where the comparison to zero
            #will fail with a TypeError. 
            raise TypeError("Read size should be an integer, not None")
        if (size == 0 or self._mode == _MODE_READ_EOF or
            not self._fill_buffer()):
            return b""
        if 0 < size < len(self._buffer):
            data = self._buffer[:size]
            self._buffer = self._buffer[size:]
        else:
            data = self._buffer
            self._buffer = None
        self._pos += len(data)
        return data
281482
def read(self, size=None):  # pylint: disable=invalid-name
        """"""
        if size is None or size < 0:
            raise exceptions.NotYetImplementedError(
                'Illegal read of size %s requested on BufferedStream. '
                'Wrapped stream %s is at position %s-%s, '
                '%s bytes remaining.' %
                (size, self.__stream, self.__start_pos, self.__end_pos,
                 self._bytes_remaining))

        data = ''
        if self._bytes_remaining:
            size = min(size, self._bytes_remaining)
            data = self.__buffered_data[
                self.__buffer_pos:self.__buffer_pos + size]
            self.__buffer_pos += size
        return data
208423
def read(self, size=None):
    
    if size is None:
      return self.buf.read() + self.open_file.read()
    contents = self.buf.read(size)
    if len(contents) < size:
      contents += self.open_file.read(size - len(contents))
    return contents
328289
def read(self, count):
        

        if not self.data:
            raise UnpackException(None, count, 0)

        buff = self.data.read(count)
        if len(buff) < count:
            raise UnpackException(None, count, len(buff))

        return buff
1025853
def get_chunk(self, size=None):
        
        if size is None:
            size = self._chunksize
        return self.read(nrows=size)
1117633
def read_string(self, size):
        
        if size < 0:
            raise errors.DecodeError('Negative size %d' % size)
        s = self._input.read(size)
        if len(s) != size:
            raise errors.DecodeError('String claims to have %d bytes, but read %d' % (size, len(s)))
        self._pos += len(s)  # Only advance by the number of bytes actually read.
        return s
12745
def get_byte_length(self, decoded=True) -> int:
        
        end = len(self.decoded_bits) if decoded else len(self.__plain_bits)
        end = self.convert_index(end, 0, 2, decoded=decoded)[0]
        return int(end)
1205095
def read_b(self, size):
        
        return self.__buff[self.__idx:self.__idx + size]