Reads a byte string from the image object at the specified offset.

    Args:
      offset (int): offset where to start reading.
      size (int): number of bytes to read.

    Returns:
      bytes: data read.
432567
def read(self, offset, size):
    
    self._file_object.seek(offset, os.SEEK_SET)
    return self._file_object.read(size)
1055370
def _peek(self, size=-1):
        
        with self._seek_lock:
            seek = self._seek
        with handle_os_exceptions():
            return self._read_range(seek, seek + size)
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)
40754
def read_byte(self, base, offset=0):
        
        fmt = 'B'
        return self._read_int(fmt, base, offset)
474977
def read(self, path, filename=None, offset=None, size=-1):
        
        storageScheme, key = self.getkey(path, filename=filename)

        if offset or (size > -1):
            if not offset:
                offset = 0
            if size > -1:
                sizeStr = offset + size - 1  # range header is inclusive
            else:
                sizeStr = ""
            headers = {"Range": "bytes=%d-%s" % (offset, sizeStr)}
            return key.get_contents_as_string(headers=headers)
        else:
            return key.get_contents_as_string()
33940
def read(self, size):
        
        try:
            return self.handle.read(size)
        except (OSError, serial.SerialException):
            print()
            print("Piksi disconnected")
            print()
            self.handle.close()
            raise IOError
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
629544
def _read(self, size):
        
        if self.comptype == "tar":
            return self.__read(size)

        c = len(self.dbuf)
        while c < size:
            buf = self.__read(self.bufsize)
            if not buf:
                break
            try:
                buf = self.cmp.decompress(buf)
            except IOError:
                raise ReadError("invalid compressed data")
            self.dbuf += buf
            c += len(buf)
        buf = self.dbuf[:size]
        self.dbuf = self.dbuf[size:]
        return buf
424140
public static byte[] readBytes(byte b[], int offset, int length) {
    byte[] retValue = new byte[length];
    System.arraycopy(b, offset, retValue, 0, length);
    return retValue;
  }
1233032
def read(self, count):
        

        offset = self.offset
        if self.data:
            avail = len(self.data) - offset
        else:
            avail = 0

        if avail < count:
            raise UnpackException(None, count, avail)

        self.offset = offset + count
        return self.data[offset:self.offset]
1205095
def read_b(self, size):
        
        return self.__buff[self.__idx:self.__idx + size]
476955
def read(self, size=1024):
        
        b = super(PtyProcessUnicode, self).read(size)
        return self.decoder.decode(b, final=False)
484274
def read(self, offset, length):
        
        self._file.seek(offset)
        return self._file.read(length)
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
693999
def readBuffer(self, newLength):
        
        result = Buffer(self.buf, self.offset, newLength)
        self.skip(newLength)
        return result
980473
def size_in_bytes(self, offset, timestamp, key, value, headers=None):
        
        assert not headers, "Headers not supported in v0/v1"
        magic = self._magic
        return self.LOG_OVERHEAD + self.record_size(magic, key, value)
1240762
def read(self, size):
		
		data = self.serial_h.read(size)
		self.logger.debug('read data, length: ' + str(len(data)) + ' data: ' + binascii.b2a_hex(data).decode('utf-8'))
		self.serial_h.write(ACK)
		if sys.version_info[0] == 2:
			data = bytearray(data)
		return data