readData -- read the values of the registers to be written, along with
the reference and count for the registers to be read.
422585
public void readData(DataInput input) throws IOException {
        readReference = input.readUnsignedShort();
        readCount = input.readUnsignedShort();
        writeReference = input.readUnsignedShort();
        writeCount = input.readUnsignedShort();
        int byteCount = input.readUnsignedByte();

        if (nonWordDataHandler == null) {
            byte buffer[] = new byte[byteCount];
            input.readFully(buffer, 0, byteCount);

            int offset = 0;
            registers = new Register[writeCount];

            for (int register = 0; register < writeCount; register++) {
                registers[register] = new SimpleRegister(buffer[offset], buffer[offset + 1]);
                offset += 2;
            }
        }
        else {
            nonWordDataHandler.readData(input, writeReference, writeCount);
        }
    }
233496
def do_read(self, args):
        """"""
        args = args.split()
        if _debug: ReadPropertyMultipleConsoleCmd._debug("do_read %r", args)

        try:
            i = 0
            addr = args[i]
            i += 1

            read_access_spec_list = []
            while i < len(args):
                obj_id = ObjectIdentifier(args[i]).value
                i += 1

                prop_reference_list = []
                while i < len(args):
                    prop_id = args[i]
                    if prop_id not in PropertyIdentifier.enumerations:
                        break

                    i += 1
                    if prop_id in ('all', 'required', 'optional'):
                        pass
                    else:
                        datatype = get_datatype(obj_id[0], prop_id)
                        if not datatype:
                            raise ValueError("invalid property for object type")

                    # build a property reference
                    prop_reference = PropertyReference(
                        propertyIdentifier=prop_id,
                        )

                    # check for an array index
                    if (i < len(args)) and args[i].isdigit():
                        prop_reference.propertyArrayIndex = int(args[i])
                        i += 1

                    # add it to the list
                    prop_reference_list.append(prop_reference)

                # check for at least one property
                if not prop_reference_list:
                    raise ValueError("provide at least one property")

                # build a read access specification
                read_access_spec = ReadAccessSpecification(
                    objectIdentifier=obj_id,
                    listOfPropertyReferences=prop_reference_list,
                    )

                # add it to the list
                read_access_spec_list.append(read_access_spec)

            # check for at least one
            if not read_access_spec_list:
                raise RuntimeError("at least one read access specification required")

            # build the request
            request = ReadPropertyMultipleRequest(
                listOfReadAccessSpecs=read_access_spec_list,
                )
            request.pduDestination = Address(addr)
            if _debug: ReadPropertyMultipleConsoleCmd._debug("    - request: %r", request)

            # make an IOCB
            iocb = IOCB(request)
            if _debug: ReadPropertyMultipleConsoleCmd._debug("    - iocb: %r", iocb)

            # give it to the application
            deferred(this_application.request_io, iocb)

            # wait for it to complete
            iocb.wait()

            # do something for success
            if iocb.ioResponse:
                apdu = iocb.ioResponse

                # should be an ack
                if not isinstance(apdu, ReadPropertyMultipleACK):
                    if _debug: ReadPropertyMultipleConsoleCmd._debug("    - not an ack")
                    return

                # loop through the results
                for result in apdu.listOfReadAccessResults:
                    # here is the object identifier
                    objectIdentifier = result.objectIdentifier
                    if _debug: ReadPropertyMultipleConsoleCmd._debug("    - objectIdentifier: %r", objectIdentifier)

                    # now come the property values per object
                    for element in result.listOfResults:
                        # get the property and array index
                        propertyIdentifier = element.propertyIdentifier
                        if _debug: ReadPropertyMultipleConsoleCmd._debug("    - propertyIdentifier: %r", propertyIdentifier)
                        propertyArrayIndex = element.propertyArrayIndex
                        if _debug: ReadPropertyMultipleConsoleCmd._debug("    - propertyArrayIndex: %r", propertyArrayIndex)

                        # here is the read result
                        readResult = element.readResult

                        sys.stdout.write(propertyIdentifier)
                        if propertyArrayIndex is not None:
                            sys.stdout.write("[" + str(propertyArrayIndex) + "]")

                        # check for an error
                        if readResult.propertyAccessError is not None:
                            sys.stdout.write(" ! " + str(readResult.propertyAccessError) + '\n')

                        else:
                            # here is the value
                            propertyValue = readResult.propertyValue

                            # find the datatype
                            datatype = get_datatype(objectIdentifier[0], propertyIdentifier)
                            if _debug: ReadPropertyMultipleConsoleCmd._debug("    - datatype: %r", datatype)
                            if not datatype:
                                raise TypeError("unknown datatype")

                            # special case for array parts, others are managed by cast_out
                            if issubclass(datatype, Array) and (propertyArrayIndex is not None):
                                if propertyArrayIndex == 0:
                                    value = propertyValue.cast_out(Unsigned)
                                else:
                                    value = propertyValue.cast_out(datatype.subtype)
                            else:
                                value = propertyValue.cast_out(datatype)
                            if _debug: ReadPropertyMultipleConsoleCmd._debug("    - value: %r", value)

                            sys.stdout.write(" = " + str(value) + '\n')
                        sys.stdout.flush()

            # do something for error/reject/abort
            if iocb.ioError:
                sys.stdout.write(str(iocb.ioError) + '\n')

        except Exception, error:
            ReadPropertyMultipleConsoleCmd._exception("exception: %r", error)
1049953
private function _readImData()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);

		// get spliced record data
		$splicedRecordData = $this->_getSplicedRecordData();
		$recordData = $splicedRecordData['recordData'];

		// UNDER CONSTRUCTION

		// offset: 0; size: 2; image format
		$cf = self::_GetInt2d($recordData, 0);

		// offset: 2; size: 2; environment from which the file was written
		$env = self::_GetInt2d($recordData, 2);

		// offset: 4; size: 4; length of the image data
		$lcb = self::_GetInt4d($recordData, 4);

		// offset: 8; size: var; image data
		$iData = substr($recordData, 8);

		switch ($cf) {
		case 0x09: // Windows bitmap format
			// BITMAPCOREINFO
			// 1. BITMAPCOREHEADER
			// offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure
			$bcSize = self::_GetInt4d($iData, 0);
//			var_dump($bcSize);

			// offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels
			$bcWidth = self::_GetInt2d($iData, 4);
//			var_dump($bcWidth);

			// offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels.
			$bcHeight = self::_GetInt2d($iData, 6);
//			var_dump($bcHeight);
			$ih = imagecreatetruecolor($bcWidth, $bcHeight);

			// offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1

			// offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24
			$bcBitCount = self::_GetInt2d($iData, 10);
//			var_dump($bcBitCount);

			$rgbString = substr($iData, 12);
			$rgbTriples = array();
			while (strlen($rgbString) > 0) {
				$rgbTriples[] = unpack('Cb/Cg/Cr', $rgbString);
				$rgbString = substr($rgbString, 3);
			}
			$x = 0;
			$y = 0;
			foreach ($rgbTriples as $i => $rgbTriple) {
				$color = imagecolorallocate($ih, $rgbTriple['r'], $rgbTriple['g'], $rgbTriple['b']);
				imagesetpixel($ih, $x, $bcHeight - 1 - $y, $color);
				$x = ($x + 1) % $bcWidth;
				$y = $y + floor(($x + 1) / $bcWidth);
			}
			//imagepng($ih, 'image.png');

			$drawing = new PHPExcel_Worksheet_Drawing();
			$drawing->setPath($filename);
			$drawing->setWorksheet($this->_phpSheet);

			break;

		case 0x02: // Windows metafile or Macintosh PICT format
		case 0x0e: // native format
		default;
			break;

		}

		// _getSplicedRecordData() takes care of moving current position in data stream
	}
1029462
synchronized int read(byte[] data) {
        this.header = getHeaderParser().setData(data).parseHeader();
        if (data != null) {
            setData(header, data);
        }

        return status;
    }
604172
public void readData(DataInput din) throws IOException {
        function = din.readUnsignedShort();
        data = (short)(din.readShort() & 0xFFFF);
    }
1354975
def read_holding_registers(slave_id, starting_address, quantity):
    
    function = ReadHoldingRegisters()
    function.starting_address = starting_address
    function.quantity = quantity

    return _create_request_adu(slave_id, function.request_pdu)
657387
@Override
    public void readObject(DataInputStream dataInputStream, ObjectManagerState objectManagerState) throws ObjectManagerException, IOException
    {
    	final String methodName = "readObject";
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, methodName, "bytes available==" + dataInputStream.available());

        super.readObject(dataInputStream, objectManagerState);

        long serialVersionUIDRead = dataInputStream.readLong();
       
        _uniqueID = dataInputStream.readLong();
        _streamID = dataInputStream.readLong();
        _lockID = dataInputStream.readLong();
        _referredID = dataInputStream.readLong();
        _sequence = dataInputStream.readLong();
        _expiryTime = dataInputStream.readLong();

        // redeliveredCount was added for serialVersionUIDV1 and later.
        // otherwise set it to 0.
        if (serialVersionUIDRead == serialVersionUIDV0)
          _redeliveredCount = 0;
        else
          _redeliveredCount = dataInputStream.readInt();

        _storageStrategy = dataInputStream.readInt();
        _priority = dataInputStream.readInt();
        _persistentSize = dataInputStream.readInt();
        _maxDepth = dataInputStream.readInt();

        _canExpireSilently = dataInputStream.readBoolean();
        _containsExpirables = dataInputStream.readBoolean();

        // Read the strings in but only if they were
        // not null on the write.
        boolean read = dataInputStream.readBoolean();
        if (read)
        {
            _type = dataInputStream.readUTF();
        }
        read = dataInputStream.readBoolean();
        if (read)
        {
            _className = dataInputStream.readUTF();
        }

        // In order to read in the tran ID we need to read
        // its length so we can create the byte array.
        int length = dataInputStream.readInt();

        if (length != -1)
        {
            _transactionId = new byte[length];

            dataInputStream.readFully(_transactionId, 0, length);
        }

        // Call the Tokens to read themselves in but
        // only if the flag preceding them says that
        // they exist in the stream.
        read = dataInputStream.readBoolean();
        if (read)
        {
            _streamListToken = Token.restore(dataInputStream, objectManagerState);
        }
        read = dataInputStream.readBoolean();
        if (read)
        {
            _itemListToken = Token.restore(dataInputStream, objectManagerState);
        }
        read = dataInputStream.readBoolean();
        if (read)
        {
            _rawDataToken = Token.restore(dataInputStream, objectManagerState);
        }
        read = dataInputStream.readBoolean();
        if (read)
        {
            _streamListEntryToken = Token.restore(dataInputStream, objectManagerState);
        }
        read = dataInputStream.readBoolean();
        if (read)
        {
            _itemListEntryToken = Token.restore(dataInputStream, objectManagerState);
        }

        // _deliveryDelayTime was added for serialVersionUID=2 and serialVersionUIDV1 
        // in releases 8.5.6 and higher.
        if (serialVersionUIDRead == serialVersionUIDV0) {
        	_deliveryDelayTime = 0;
        } else if (serialVersionUIDRead == serialVersionUIDV1) {
        	
        	// _deliveryDelayTime was initially added without changing serialVersionUID, so 
        	// PersistableMetaData was stored using serialVersionUIDV1 and may or may not contain 
        	// _deliveryDelayTime. If there are fewer than 8 bytes remaining in the dataInputStream 
        	// then we can safely assume the _deliveryDelayTime was not stored.
            if (dataInputStream.available() >= 8 && _className.equals("com.ibm.ws.sib.processor.impl.store.items.MessageItem")) {
                _deliveryDelayTime = dataInputStream.readLong();
                // We could have just read garbage from spare space in the ObjectStore.
                _deliveryDelayTimeIsSuspect = true;
            }
            else 
        	    _deliveryDelayTime = 0;  
        } else {
        	_deliveryDelayTime = dataInputStream.readLong();
        }

        // Reset _estimatedLength so that it is re-calculated
        // when it is needed.
        _estimatedLength = -1;
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, methodName, "serialVersionUIDRead="+serialVersionUIDRead+" bytes available==" + dataInputStream.available());
    }
809800
private int read() {
        int curByte = 0;
        try {
            curByte = rawData.get() & 0xFF;
        } catch (Exception e) {
            header.status = GifDecoder.STATUS_FORMAT_ERROR;
        }
        return curByte;
    }
755461
def read_reg(self, addr):
        
        # we don't call check_command here because read_reg() function is called
        # when detecting chip type, and the way we check for success (STATUS_BYTES_LENGTH) is different
        # for different chip types (!)
        val, data = self.command(self.ESP_READ_REG, struct.pack('<I', addr))
        if byte(data, 0) != 0:
            raise FatalError.WithResult("Failed to read register address %08x" % addr, data)
        return val
456136
def read(self, addr, size):
        '''

        '''
        self.set_addr(addr | 0x01)
        self.set_size(size)
        self.start()
        while not self.is_ready:
            pass

        return self.get_data(size)
182634
def read_all(self):
        
        result = self._data[self._position:]
        self._position = None  # ensure no subsequent read()
        return result
859718
protected synchronized int read(byte[] data, int offset, int len)
			throws IOException {
		try {

			block();
		} catch (InterruptedException ex) {
			throw new InterruptedIOException(
					"The blocking operation was interrupted");
		}

		if (closed && available() <= 0) {
			return -1;
		}

		int read = (len > (writepos - readpos)) ? (writepos - readpos) : len;
		System.arraycopy(buf, readpos, data, offset, read);
		readpos += read;

		return read;

	}
51625
@Override
	public void read(final DataInput in) throws IOException {

		synchronized (this.confData) {

			final int numberOfProperties = in.readInt();

			for (int i = 0; i < numberOfProperties; i++) {
				final String key = StringRecord.readString(in);
				final String value = StringRecord.readString(in);
				this.confData.put(key, value);
			}
		}
	}
279585
def read_data(self, file_handle):
        """"""
        self._verify_assumptions()
        text = self.annotation

        if (self._data_start > self._file_size) or (self._data_end > self._file_size):
            raise ValueError(u'The FCS file "{}" is corrupted. Part of the data segment '
                             u'is missing.'.format(self.path))

        num_events = text['$TOT']  # Number of events recorded
        num_pars = text['$PAR']  # Number of parameters recorded

        if text['$BYTEORD'].strip() == '1,2,3,4' or text['$BYTEORD'].strip() == '1,2':
            endian = '<'
        elif text['$BYTEORD'].strip() == '4,3,2,1' or text['$BYTEORD'].strip() == '2,1':
            endian = '>'
        else:
            msg = 'Unrecognized byte order ({})'.format(text['$BYTEORD'])
            raise ParserFeatureNotImplementedError(msg)

        # dictionary to convert from FCS format to numpy convention
        conversion_dict = {'F': 'f', 'D': 'f', 'I': 'u'}

        if text['$DATATYPE'] not in conversion_dict.keys():
            raise ParserFeatureNotImplementedError('$DATATYPE = {0} is not yet '
                                                   'supported.'.format(text['$DATATYPE']))

        # Calculations to figure out data types of each of parameters
        # $PnB specifies the number of bits reserved for a measurement of parameter n
        bytes_per_par_list = [int(text['$P{0}B'.format(i)] / 8) for i in self.channel_numbers]

        par_numeric_type_list = [
            '{endian}{type}{size}'.format(endian=endian,
                                          type=conversion_dict[text['$DATATYPE']],
                                          size=bytes_per_par)
            for bytes_per_par in bytes_per_par_list
        ]

        # Parser for list mode. Here, the order is a list of tuples.
        # Each tuple stores event related information
        file_handle.seek(self._data_start, 0)  # Go to the part of the file where data starts

        ##
        # Read in the data
        if len(set(par_numeric_type_list)) > 1:
            # This branch deals with files in which the different columns (channels)
            # were encoded with different types; i.e., a mixed data format.
            dtype = ','.join(par_numeric_type_list)
            data = fromfile(file_handle, dtype, num_events)

            # The dtypes in the numpy array `data` above are associated with both a name
            # and a type; i.e.,
            # https://docs.scipy.org/doc/numpy/reference/generated/numpy.recarray.html
            # The names are assigned automatically.
            # In order for this code to work correctly with the pandas DataFrame constructor,
            # we convert the *names* of the dtypes to the channel names we want to use.

            names = self.get_channel_names()

            if six.PY2:
                encoded_names = [name.encode('ascii', errors='replace') for name in names]
            else:  # Assume that python3 or older then.
                encoded_names = [name for name in names]

            data.dtype.names = tuple(encoded_names)
        else:
            # values saved in a single data format
            dtype = par_numeric_type_list[0]
            data = fromfile(file_handle, dtype, num_events * num_pars)
            data = data.reshape((num_events, num_pars))
        ##
        # Convert to native byte order
        # This is needed for working with pandas data structures
        native_code = '<' if (sys.byteorder == 'little') else '>'
        if endian != native_code:
            # swaps the actual bytes and also the endianness
            data = data.byteswap().newbyteorder()

        self._data = data
387339
def read(self, n=1):
        
        self.offset += n
        return self.data[self.offset - n:self.offset]
29804
private void read() throws IOException {
		// read specifications for standard fields and data directories
		Map<String, String[]> standardSpec = IOUtil.readMap(STANDARD_SPEC);

		// read magic number
		this.magicNumber = readMagicNumber(standardSpec);

		/* load fields */
		loadStandardFields();
		loadWindowsSpecificFields();
		loadDataDirectory();
	}
775245
def set_register(self, reg, data):
        
        if reg < 0:
            return
        elif reg < len(self._register_list):
            regName = self._register_list[reg].name
            regBits = self._register_list[reg].bitsize
            if regBits == 64:
                value = conversion.hex16_to_u64be(data)
            else:
                value = conversion.hex8_to_u32be(data)
            logging.debug("GDB: write reg %s: 0x%X", regName, value)
            self._context.write_core_register_raw(regName, value)