Read the physical data from a stream file and set this field.
@param daIn Input stream to read this field's data from
@return boolean Success?
161325
public boolean read(DataInputStream daIn, boolean bFixedLength) // Fixed length = false
    {
        try   {
            float fData = daIn.readFloat();
            Float flData = null;
            if (!Float.isNaN(fData))
                flData = new Float(fData);
            int errorCode = this.setData(flData, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE);
            return (errorCode == DBConstants.NORMAL_RETURN);    // Success
        } catch (IOException ex)    {
            ex.printStackTrace();
            return false;
        }
    }
118414
public function read($dn)
	{
		$base = substr($dn, strpos($dn, ',') + 1);
		$cn = substr($dn, 0, strpos($dn, ','));
		$result = @ldap_read($this->resource, $base, $cn);

		if ($result)
		{
			return @ldap_get_entries($this->resource, $result);
		}
		else
		{
			return $result;
		}
	}
102036
@Override
  public synchronized int read(byte buf[], int off, int len) throws IOException {
    dfsClient.checkOpen();
    if (closed) {
      dfsClient.incReadExpCntToStats();

      throw new IOException("Stream closed");
    }
    DFSClient.dfsInputStreamfailures.set(0);
    long start = System.currentTimeMillis();
    
    if (pos < getFileLength() || (pos == getFileLength() && len == 0)) {
      int retries = 2;
      while (retries > 0) {
        try {
          // If position equals or is larger than the end position of the
          // block, we try to seek to the next block, unless:
          // 1. user tries to read 0 bytes (usually by available() call), AND
          // 2. there is at least a known block for the file (blockEnd != -1), AND
          // 3. pos is the end of the file, AND
          // 4. the end of the block is the end of the file
          //    (the current block is the known last block of the file)
          // For this case, we want to stay in the current block, as in the case
          // that it is the last block (which is almost always true given
          // len == 0), the current block is the under-construction block whose size
          // you want to update.
          //
          if (len == 0) { // called by available()
            if (blockEnd == -1 // No current block selected
                || pos == getFileLength()) { // at the end of the file
              currentNode = blockSeekTo(pos, false);
              if (currentNode == null) {
                // In this case, user wants to know available information of
                // the file, but the file doesn't have any block created yet (it
                // is a 0 size file). Simply 0 should be returned.
                return 0;
              }
            } else {
              throw new IOException(
                  "Try to read 0 bytes while current position is not the end of the file");
            }
          } else if (pos > blockEnd
              || (this.isCurrentBlockUnderConstruction && blockReader != null
                  && blockReader.eos && blockReader.available() == 0)) {
            currentNode = blockSeekTo(pos, true);
          }
          
          int realLen = (int) Math.min((long) len, (blockEnd - pos + 1L));
          int result = readBuffer(buf, off, realLen);

          if (result >= 0) {
            pos += result;
          } else if (len != 0){
            // got a EOS from reader though we expect more data on it.
            throw new IOException("Unexpected EOS from the reader");
          }
          if (dfsClient.stats != null && result != -1) {
            dfsClient.stats.incrementBytesRead(result);
          }
          long timeval = System.currentTimeMillis() - start;
          dfsClient.metrics.incReadTime(timeval);
          dfsClient.metrics.incReadSize(result);
          dfsClient.metrics.incReadOps();
          return (result >= 0) ? result : 0;
        } catch (InterruptedIOException iie) {
          throw iie;
        } catch (ChecksumException ce) {
          dfsClient.incReadExpCntToStats();

          throw ce;
        } catch (IOException e) {
          dfsClient.incReadExpCntToStats();

          if (retries == 1) {
            DFSClient.LOG.warn("DFS Read: " + StringUtils.stringifyException(e));
          }
          blockEnd = -1;
          if (currentNode != null) { addToDeadNodes(currentNode); }
          if (--retries == 0) {
            if (len != 0) {
              throw e;
            } else {
              // When called by available(). No need to fail the query. In that case
              // available() value might not be updated, but it's OK.
              return 0;
            }
          }
        }
      }
    }
    return -1;
  }
270950
public Asn1Object read() throws IOException {
        int tag = in.read();

        if (tag == -1)
            throw new IOException("Invalid DER: stream too short, missing tag"); //$NON-NLS-1$

        int length = getLength();

        byte[] value = new byte[length];
        int n = in.read(value);
        if (n < length)
            throw new IOException("Invalid DER: stream too short, missing value"); //$NON-NLS-1$

        Asn1Object o = new Asn1Object(tag, length, value);

        return o;
    }
927944
public static void read(InputStream stream, byte[] buffer) throws IOException {
        int read = 0;
        while(read < buffer.length) {
            int newlyRead = stream.read(buffer, read, buffer.length - read);
            if(newlyRead == -1)
                throw new EOFException("Attempt to read " + buffer.length
                                       + " bytes failed due to EOF.");
            read += newlyRead;
        }
    }
914369
@SuppressWarnings("resource")
    private static BerDataValue readDataValue(InputStream input)
            throws BerDataValueFormatException {
        RecordingInputStream in = new RecordingInputStream(input);

        try {
            int firstIdentifierByte = in.read();
            if (firstIdentifierByte == -1) {
                // End of input
                return null;
            }
            int tagNumber = readTagNumber(in, firstIdentifierByte);

            int firstLengthByte = in.read();
            if (firstLengthByte == -1) {
                throw new BerDataValueFormatException("Missing length");
            }

            boolean constructed = BerEncoding.isConstructed((byte) firstIdentifierByte);
            int contentsLength;
            int contentsOffsetInDataValue;
            if ((firstLengthByte & 0x80) == 0) {
                // short form length
                contentsLength = readShortFormLength(firstLengthByte);
                contentsOffsetInDataValue = in.getReadByteCount();
                skipDefiniteLengthContents(in, contentsLength);
            } else if ((firstLengthByte & 0xff) != 0x80) {
                // long form length
                contentsLength = readLongFormLength(in, firstLengthByte);
                contentsOffsetInDataValue = in.getReadByteCount();
                skipDefiniteLengthContents(in, contentsLength);
            } else {
                // indefinite length
                contentsOffsetInDataValue = in.getReadByteCount();
                contentsLength =
                        constructed
                                ? skipConstructedIndefiniteLengthContents(in)
                                : skipPrimitiveIndefiniteLengthContents(in);
            }

            byte[] encoded = in.getReadBytes();
            ByteBuffer encodedContents =
                    ByteBuffer.wrap(encoded, contentsOffsetInDataValue, contentsLength);
            return new BerDataValue(
                    ByteBuffer.wrap(encoded),
                    encodedContents,
                    BerEncoding.getTagClass((byte) firstIdentifierByte),
                    constructed,
                    tagNumber);
        } catch (IOException e) {
            throw new BerDataValueFormatException("Failed to read data value", e);
        }
    }
189797
protected boolean readPage ()
        throws IOException
    {
        int result;
        while ((result = _sync.pageout(_page)) != 1) {
            if (result == 0 && !readChunk()) {
                return false;
            }
        }
        _stream.pagein(_page);
        return true;
    }
226899
void readToData(boolean returnOnYield)
        throws IOException
    {
        InputStream is = getInputStream();

        if (is == null)
            return;

        for (int tag = is.read(); tag >= 0; tag = is.read()) {
            switch (tag) {
                case 'Y':
                    server.freeReadLock();
                    if (returnOnYield)
                        return;
                    server.readChannel(channel);
                    break;

                case 'Q':
                    server.freeReadLock();
                    this.is = null;
                    this.server = null;
                    return;

                case 'U':
                    this.url = readUTF();
                    break;

                case 'D':
                    chunkLength = (is.read() << 8) + is.read();
                    return;

                default:
                    readTag(tag);
                    break;
            }
        }
    }
1214059
@Deprecated
    @Override
    public void read(final File input) {
        assert input.isAbsolute();
        read(input.toURI());
    }
122312
public boolean read(DataInputStream daIn, boolean bFixedLength) // Fixed length = false
    {
        try   {
            String string = null;
            if (bFixedLength)
            {   // HACK Change this to use the system's default byte to char encoding
                byte[] byData = new byte[this.getMaxLength()];
                daIn.readFully(byData, 0, this.getMaxLength());   // Get the bytes and convert to Char
                int iCount;
                for (iCount = 0; iCount < this.getMaxLength(); iCount++)
                {
                    if (byData[iCount] == 0)
                        break;
                }
                string = new String(byData, 0, iCount, "8859_1");
            }
            else
                string = daIn.readUTF();
            if (string == null)
                return false;
            int errorCode = this.setString(string, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE);
            return (errorCode == DBConstants.NORMAL_RETURN);    // Success
        } catch (IOException ex)    {
            ex.printStackTrace();
            return false;
        }
    }
318461
function stream_seek($offset, $whence)
    {
        if ($whence == SEEK_SET && $offset >= 0) {
            $this->pos = $offset;
        } elseif ($whence == SEEK_CUR && -$offset <= $this->pos) {
            $this->pos += $offset;
        } elseif ($whence == SEEK_END && -$offset <= sizeof($this->data)) {
            $this->pos = strlen($this->data) + $offset;
        } else {
            return false;
        }
        return true;
    }
111738
public final int read(byte[] dst, int offset, int length) throws IOException
    {
        if (!is_byte_data()) {
            throw new IOException("byte read is not support over character sources");
        }
        int remaining = length;
        while (remaining > 0 && !isEOF()) {
            int ready = _limit - _pos;
            if (ready > remaining) {
                ready = remaining;
            }
            System.arraycopy(_bytes, _pos, dst, offset, ready);
            _pos += ready;
            offset += ready;
            remaining -= ready;
            if (remaining == 0 || _pos < _limit || refill_helper()) {
                break;
            }
        }
        return length - remaining;
    }
1105855
public boolean read(Input in) throws NamingException {
    clear();

    this.in = in;
//    somedata = false;
    haveControls = false;
    crec = null;

    for (;;) {
      int alen = -1;

      try {
        crec = in.readFullLine();
      } catch (Exception e) {
        throwmsg(e.getMessage());
      }

      int inLen = 0;
      if (crec != null) {
        inLen = crec.length();
      }

      /*
       System.out.println("ldifrec len=" + inLen + " data=" + crec +
           " state=" + state); */

      if (crec != null) {
        ldifData.addElement(crec);

        alen = crec.indexOf(':');
      }

      // Null terminator means we're done
      if (inLen == 0) {
        // There are some state we should not be in here
        if (state == stateModSpec) { // Any others?
          invalid();
        }
        break;
      }

      if ((inLen > 0) && (crec.startsWith("#"))) {
        // Comment line. Ignore it.
      } else if (alen > 0) {
        /** We have something of the form
               <name> : <val> or
               <name> :: <encoded-val> or    for base-64 encoded data
               <name> :< <url>               for the url of an inclusion
         */
        String attr = null;
        StringBuffer val = null;
        boolean encoded = false;
        boolean url = false;
        int valStart;

        valStart = alen + 1;

        if (valStart == inLen) {
          throw new NamingException("Bad input value \"" + crec + "\"");
        } else if ((alen < inLen) && (crec.charAt(valStart) == ':')) {
          valStart++;
          encoded = true;
        } else if ((alen < inLen) && (crec.charAt(valStart) == '<')) {
          valStart++;
          url = true;
        }

        while ((valStart < inLen) && (crec.charAt(valStart) == ' ')) {
          valStart++;
        }

        attr = crec.substring(0, alen).toLowerCase();
        val = new StringBuffer(crec.substring(valStart));

        addAttrVal(attr, val.toString(), encoded, url);
      } else if ((state == stateModSpec) && (inLen == 1) && (crec.equals("-"))) {
        // We have a current change to add to the change vector.
        if (changes == null) {
          changes = new Vector();
        }
        changes.addElement(curChange);
        curChange = null;
        state = stateModify;
      } else if (inLen > 0) {
        invalid();
      }
    }

    return somedata;
  }
210527
public boolean read(File inputFile) throws SAXException, IOException {
        boolean success = false;
        try (FileInputStream fs = new FileInputStream(inputFile)) {
            XMLReader parser = XMLReaderFactory.createXMLReader();
            parser.setErrorHandler(this);
            parser.setContentHandler(this);
            parser.parse(new InputSource(fs));
            success = true;
        }
        return success;
    }
1308934
public void readFrom(java.io.InputStream is) throws IOException {
        int howmuch = 0;
        do {
            _write_pos += howmuch;
            moveWindow(_write_pos);
            howmuch = is.read(_memory_buffer);
        } while (howmuch != -1);
    }
1296037
public boolean read(DataInputStream daIn, boolean bFixedLength) // Fixed length = false
    {
        ObjectInputStream iStream = null;
        try   {
            iStream = new ObjectInputStream(daIn);
            Object objData = iStream.readObject();
            if (objData instanceof String) if (((String)objData).length() == 0)
                objData = null;
            int errorCode = this.setData(objData, false, DBConstants.READ_MOVE);
            iStream.close();    // Unlink ObjectInputStream
            return (errorCode == DBConstants.NORMAL_RETURN);    // Success
        } catch (IOException ex)    {
            ex.printStackTrace();   // Never
        } catch (ClassNotFoundException ex)   {
            ex.printStackTrace();   // Never
        }
        return false; // Error
    }
722567
public boolean readBoolean()
        throws IOException
    {
        int tag = read();

        switch (tag) {
            case 'T':
                return true;
            case 'F':
                return false;
            case 'I':
                return parseInt() == 0;
            case 'L':
                return parseLong() == 0;
            case 'D':
                return parseDouble() == 0.0;
            case 'N':
                return false;

            default:
                throw expect("boolean", tag);
        }
    }