readData -- input the Modbus message from din. If there was a header,
such as for Modbus/TCP, it will have been read already.
@throws java.io.IOException If the data cannot be read
356713
public void readData(DataInput din) throws IOException {

        /*
         * Read and discard the byte count.  There's no way to indicate
         * the packet was inconsistent, other than throwing an I/O
         * exception for an invalid packet format ...
         */
        din.readShort();

        // The first register is the number of registers which
        // follow.  Save that as count, not as a register.
        count = din.readUnsignedShort();
        registers = new InputRegister[count];

        for (int i = 0; i < count; i++) {
            registers[i] = new SimpleInputRegister(din.readShort());
        }
    }
426161
public void setData(byte[] data) {
        // There are always two bytes of payload in the message -- the
        // slave ID and the run status indicator.
        if (data == null) {
            m_length = 2;
            m_data = new byte[0];

            return;
        }

        if (data.length > 249) {
            throw new IllegalArgumentException("data length limit exceeded");
        }

        m_length = data.length + 2;

        m_data = new byte[data.length];
        System.arraycopy(data, 0, m_data, 0, data.length);
    }
1195821
public void readData(BufferedReader in) throws IOException {
    final String SEEN = "SEEN";
    String line;
    int lineNum = 1;
    // all lines have one tagging with raw count per line
    line = in.readLine();
    Pattern p = Pattern.compile("^smooth\\[([0-9])\\] = (.*)$");
    while (line != null && line.length() > 0) {
      try {
        Matcher m = p.matcher(line);
        if (m.matches()) {
          int i = Integer.parseInt(m.group(1));
          smooth[i] = Double.parseDouble(m.group(2));
        } else {
          // split on spaces, quote with doublequote, and escape with backslash
          String[] fields = StringUtils.splitOnCharWithQuoting(line, ' ', '\"', '\\');
          // System.out.println("fields:\n" + fields[0] + "\n" + fields[1] +
          // "\n" + fields[2] + "\n" + fields[3] + "\n" + fields[4]);
          boolean seen = fields[3].equals(SEEN);
          addTagging(seen, new IntTaggedWord(fields[2], fields[0], wordIndex, tagIndex), Double.parseDouble(fields[4]));
        }
      } catch (RuntimeException e) {
        throw new IOException("Error on line " + lineNum + ": " + line, e);
      }
      lineNum++;
      line = in.readLine();
    }
    initRulesWithWord();
  }
173169
private void readData(StringBuilder powerShellOutput) throws IOException {
        String line;
        while (null != (line = this.reader.readLine())) {

            //In the case of script mode it finish when the last line is read
            if (this.scriptMode) {
                if (line.equals(PowerShell.END_SCRIPT_STRING)) {
                    break;
                }
            }

            powerShellOutput.append(line).append(CRLF);

            //When not in script mode, it exits when the command is finished
            if (!this.scriptMode) {
                try {
                    if (this.closed || !canContinueReading()) {
                        break;
                    }
                } catch (InterruptedException ex) {
                    Logger.getLogger(PowerShellCommandProcessor.class.getName()).log(Level.SEVERE, "Error executing command and reading result", ex);
                }
            }
        }
    }
499282
public RequestResponse setResponseData(byte[] responseData) {
        this.responseData = responseData;
        try {
            responseJson = responseData != null ? SerializationUtils.readJson(responseData) : null;
        } catch (Exception e) {
            responseJson = null;
            LOGGER.error(e.getMessage(), e);
        }
        return this;
    }
809800
private int read() {
        int curByte = 0;
        try {
            curByte = rawData.get() & 0xFF;
        } catch (Exception e) {
            header.status = GifDecoder.STATUS_FORMAT_ERROR;
        }
        return curByte;
    }
1029462
synchronized int read(byte[] data) {
        this.header = getHeaderParser().setData(data).parseHeader();
        if (data != null) {
            setData(header, data);
        }

        return status;
    }
917832
public boolean read(InputStream in) throws IOException
    {
        _bytes=0;
        _pos=0;

        // read header
        do
        {
            int l=in.read(_buf,_bytes,__HDR_SIZE-_bytes);
            if (l<0)
                return false;
            _bytes+=l;
        }
        while (_bytes<__HDR_SIZE);

        // decode header
        int magic=getInt();
        if (magic!=0x1234)
            throw new IOException("Bad JSP13 rcv packet:"+magic+" "+this);
        int len=getInt();

        // check packet fits into the buffer
        int packetLength=__HDR_SIZE+len;
        if (packetLength>_buf.length)
            throw new IOException("AJP13 packet ("+packetLength+"bytes) too large for buffer ("+_buf.length+" bytes)");

        // read packet
        do
        {
            int l=in.read(_buf,_bytes,packetLength-_bytes);
            if (l<0)
                return false;
            _bytes+=l;
        }
        while (_bytes<packetLength);

        if (log.isTraceEnabled())
            log.trace("AJP13 rcv: "+this.toString(64));
        // System.err.println(Thread.currentThread()+" AJP13 rcv
        // "+this.toString());

        return true;
    }
1229369
@Override
    public long read(long numBytes, int time) throws IOException {
        int timeout = time;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "read(" + numBytes + "," + timeout + ")");
        }
        long bytesRead = 0L;

        getTCPConnLink().incrementNumReads();
        if (getConfig().getDumpStatsInterval() > 0) {
            getTCPConnLink().getTCPChannel().totalSyncReads.incrementAndGet();
        }
        // always check external call parms
        checkForErrors(numBytes, false, timeout);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Socket socket = getTCPConnLink().getSocketIOChannel().getSocket();
            Tr.event(tc, "read (sync) requested for local: " + socket.getLocalSocketAddress() + " remote: " + socket.getRemoteSocketAddress());
        }

        if (isAborted()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Previously aborted, unable to perform read");
            }
            throw new IOException("Connection aborted by program");
        }
        if (timeout == IMMED_TIMEOUT) {
            immediateTimeout();
        } else if (timeout == ABORT_TIMEOUT) {
            abort();
            immediateTimeout();
        } else {
            // if using channel timeout, reset to that value
            if (timeout == TCPRequestContext.USE_CHANNEL_TIMEOUT) {
                timeout = getConfig().getInactivityTimeout();
            }
            bytesRead = processSyncReadRequest(numBytes, timeout);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "read: " + bytesRead);
        }
        return bytesRead;
    }
614042
protected void writeMessageOut(ModbusMessage msg) throws ModbusIOException {
        try {
            int len;
            synchronized (byteOutputStream) {
                // first clear any input from the receive buffer to prepare
                // for the reply since RTU doesn't have message delimiters
                clearInput();
                // write message to byte out
                byteOutputStream.reset();
                msg.setHeadless();
                msg.writeTo(byteOutputStream);
                len = byteOutputStream.size();
                int[] crc = ModbusUtil.calculateCRC(byteOutputStream.getBuffer(), 0, len);
                byteOutputStream.writeByte(crc[0]);
                byteOutputStream.writeByte(crc[1]);
                // write message
                writeBytes(byteOutputStream.getBuffer(), byteOutputStream.size());
                if (logger.isDebugEnabled()) {
                    logger.debug("Sent: {}", ModbusUtil.toHex(byteOutputStream.getBuffer(), 0, byteOutputStream.size()));
                }
                // clears out the echoed message
                // for RS485
                if (echo) {
                    readEcho(len + 2);
                }
                lastRequest = new byte[len];
                System.arraycopy(byteOutputStream.getBuffer(), 0, lastRequest, 0, len);
            }
        }
        catch (IOException ex) {
            throw new ModbusIOException("I/O failed to write");
        }
    }
161989
public void sendData(byte[] data) throws ResponseException {
        if(con.isClosed()) return;

        Socket socket = null;
        try {
            socket = conHandler.createDataSocket();
            dataConnections.add(socket);
            OutputStream out = socket.getOutputStream();

            Utils.write(out, data, data.length, conHandler.isAsciiMode());
            bytesTransferred += data.length;

            out.flush();
            Utils.closeQuietly(out);
            Utils.closeQuietly(socket);
        } catch(SocketException ex) {
            throw new ResponseException(426, "Transfer aborted");
        } catch(IOException ex) {
            throw new ResponseException(425, "An error occurred while transferring the data");
        } finally {
            onUpdate();
            if(socket != null) dataConnections.remove(socket);
        }
    }
1370097
public void readData(DataInput din) throws IOException {
        int byteCount = din.readUnsignedByte();

        int recordCount = byteCount / 7;
        records = new RecordRequest[recordCount];

        for (int i = 0; i < recordCount; i++) {
            if (din.readByte() != 6) {
                throw new IOException();
            }

            int file = din.readUnsignedShort();
            int record = din.readUnsignedShort();
            if (record < 0 || record >= 10000) {
                throw new IOException();
            }

            int count = din.readUnsignedShort();

            records[i] = new RecordRequest(file, record, count);
        }
    }
1293417
public void readData(DataInput din) throws IOException {
        reference = din.readUnsignedShort();
        andMask = din.readUnsignedShort();
        orMask = din.readUnsignedShort();
    }
157709
private void onDataRead(int streamId, ByteBuf data, int padding, boolean endOfStream) {
    flowControlPing().onDataRead(data.readableBytes(), padding);
    NettyClientStream.TransportState stream = clientStream(requireHttp2Stream(streamId));
    stream.transportDataReceived(data, endOfStream);
    if (keepAliveManager != null) {
      keepAliveManager.onDataReceived();
    }
  }
1008857
public void read() throws IOException {
		long headerSize = header.getHeaderSize();
		int loadModuleSize = getLoadModuleSize();

		try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
			raf.seek(headerSize);
			loadModuleBytes = new byte[loadModuleSize];
			raf.readFully(loadModuleBytes);
		}
	}
389706
public void setData(InputStream in) throws IOException {
        m_dirty = true;
        FileOutputStream out = new FileOutputStream(m_dataFile);
        byte[] buf = new byte[4096];
        int i = 0;
        m_size = 0;
        while ((i = in.read(buf)) != -1) {
            m_size += i;
            out.write(buf, 0, i);
        }
        in.close();
        out.close();
    }
1179408
protected void read() throws Exception {
    InputStream is = socket.getInputStream();
    while (is.available() > 0) {
      byte[] bytes = new byte[1024 * 1024];
      int read = is.read(bytes);
      byte[] actuallyRead = new byte[read];
      System.arraycopy(bytes, 0, actuallyRead, 0, read);
      pushInput(actuallyRead);
    }
  }