Gets the reader to read the request.

@return The reader
482311
@Override
    public BufferedReader reader() throws IOException {
        byte[] raw = request.getRawBody();
        if (raw != null) {
            return IOUtils.toBufferedReader(new InputStreamReader(new ByteArrayInputStream(raw)));
        }
        return null;
    }
1183916
public synchronized XMLReader getXMLReader() throws SAXException {
        XMLReader reader;
        boolean readerInUse;

        if (m_readers == null) {
            // When the m_readers.get() method is called for the first time
            // on a thread, a new XMLReader will automatically be created.
            m_readers = new ThreadLocal();
        }

        if (m_inUse == null) {
            m_inUse = new Hashtable();
        }

        // If the cached reader for this thread is in use, construct a new
        // one; otherwise, return the cached reader.
        reader = (XMLReader) m_readers.get();
        boolean threadHasReader = (reader != null);
        if (!threadHasReader || m_inUse.get(reader) == Boolean.TRUE) {
            try {
                try {
                    // According to JAXP 1.2 specification, if a SAXSource
                    // is created using a SAX InputSource the Transformer or
                    // TransformerFactory creates a reader via the
                    // XMLReaderFactory if setXMLReader is not used
                    reader = XMLReaderFactory.createXMLReader();
                } catch (Exception e) {
                   try {
                        // If unable to create an instance, let's try to use
                        // the XMLReader from JAXP
                        if (m_parserFactory == null) {
                            m_parserFactory = SAXParserFactory.newInstance();
                            m_parserFactory.setNamespaceAware(true);
                        }

                        reader = m_parserFactory.newSAXParser().getXMLReader();
                   } catch (ParserConfigurationException pce) {
                       throw pce;   // pass along pce
                   }
                }
                try {
                    reader.setFeature(NAMESPACES_FEATURE, true);
                    reader.setFeature(NAMESPACE_PREFIXES_FEATURE, false);
                } catch (SAXException se) {
                    // Try to carry on if we've got a parser that
                    // doesn't know about namespace prefixes.
                }
            } catch (ParserConfigurationException ex) {
                throw new SAXException(ex);
            } catch (FactoryConfigurationError ex1) {
                throw new SAXException(ex1.toString());
            } catch (NoSuchMethodError ex2) {
            } catch (AbstractMethodError ame) {
            }

            // Cache the XMLReader if this is the first time we've created
            // a reader for this thread.
            if (!threadHasReader) {
                m_readers.set(reader);
                m_inUse.put(reader, Boolean.TRUE);
            }
        } else {
            m_inUse.put(reader, Boolean.TRUE);
        }

        return reader;
    }
930148
public BufferedReader getReader()
    	throws UnsupportedEncodingException
    {
        if (_inputState!=0 && _inputState!=2)
            throw new IllegalStateException();
        if (_reader==null)
        {
            String encoding=getCharacterEncoding();
            if (encoding==null)
                encoding=StringUtil.__ISO_8859_1;
            _reader=new BufferedReader(new InputStreamReader(getInputStream(),encoding));
            
        }
        _inputState=2;
        return _reader;
    }
1039757
private int get() throws IOException {
        int c = theLookahead;
        theLookahead = EOF;
        if (c == EOF) {
            c = inputStream.read();
        }
        if (c >= ' ' || c == '\n' || c == EOF) {
            return c;
        }
        if (c == '\r') {
            return '\n';
        }
        return ' ';
    }
825464
public function getStreamReader()
    {
        if ($this->streamReader !== null) {
            return $this->streamReader;
        }

        return $this->streamReader = new StreamReader($this);
    }
107419
public Document read() {
        try {
            do {
                if (stream == null) {
                    // Open the stream to the next file ...
                    stream = openNextFile();
                    if (stream == null) {
                        // No more files to read ...
                        return null;
                    }
                    documents = Json.readMultiple(stream, false);
                }
                try {
                    Document doc = documents.nextDocument();
                    if (doc != null) return doc;
                } catch (IOException e) {
                    // We'll just continue ...
                }
                // Close the stream and try opening the next stream ...
                close(stream);
                stream = null;
            } while (true);
        } catch (IOException e) {
            problems.addError(JcrI18n.problemsWritingDocumentToBackup, currentFile.getAbsolutePath(), e.getMessage());
            return null;
        }
    }
1013521
public static BufferedReader getReader(Reader reader) {
		if (null == reader) {
			return null;
		}

		return (reader instanceof BufferedReader) ? (BufferedReader) reader : new BufferedReader(reader);
	}
746631
public String read() {
    if (mode.isReadable() == false)
      throw new IllegalStateException("IOError: not opened for reading");

    StringBuilder sb = new StringBuilder();
    try {
      BufferedReader reader = new BufferedReader(new FileReader(file));
      char[] buf = new char[1024];
      int numOfChars = 0;
      while ((numOfChars = reader.read(buf)) != -1) {
        sb.append(String.valueOf(buf, 0, numOfChars));
      }
      reader.close();
    } catch (IOException e) {
      logger.log(Level.SEVERE, null, e);
      throw new RuntimeException(e);
    }
    return sb.toString();
  }
885874
public Reader getReader() throws IOException {
       // we want to remove the BOM windows adds from a file if the encoding is UTF-8
       // in other cases we depend on the charsets 
       Charset cs = Charset.forName(configuration.getSourceEncoding());
       InputStream in = new BufferedInputStream(new FileInputStream(file));
       if (UTF8.name().equalsIgnoreCase(cs.name())) {
           in.mark(3);
           boolean hasBOM = true;
           try {
               int i = in.read();
               hasBOM &= i == 0xEF;
               i = in.read();
               hasBOM &= i == 0xBB;
               i = in.read();
               hasBOM &= i == 0xFF;
           } catch (IOException ioe) {
               hasBOM= false;
           }
           if (!hasBOM) in.reset();
       }
       return new InputStreamReader( in, cs );
    }
356953
@Override
    public ServletInputStream getInputStream() throws IOException {
        if (null != this.inReader) {
            throw new IllegalStateException("Input reader already obtained");
        }
        this.streamActive = true;
        if (null == this.inStream) {
            this.inStream = new RequestBody(this.request.getBody());
        }
        return this.inStream;
    }
640573
public ReadStreamOld openRead()
    throws IOException
  {
    closeWrite();
    
    TempReadStream read = new TempReadStream(_head);
    read.setFreeWhenDone(true);
    _head = null;
    _tail = null;
    
    return new ReadStreamOld(read);
  }
866702
@Override
    public BufferedReader getReader() throws IOException {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getReader();
        } finally {
            collaborator.postInvoke();
        }
    }
334940
public T read () {
		if (size > 0) {
			size--;
			T item = items[head];
			items[head] = null; // Avoid keeping useless references
			if (++head == items.length) head = 0;
			return item;
		}

		return null;
	}
1371032
@Override
    public E peek() {
        E el;

        while (((el = super.peek()) == null) && !isDone()) {
            synchronized (this) {
                try {
                    wait();
                } catch (InterruptedException e) {
                    String s = "Reader has been interrupted maybe the connection is closed";
                    throw new RuntimeException(s);
                }
            }
        }

        if ((el == null) && isDone()) {
            String s = "Reader has been interrupted maybe the connection is closed";
            throw new RuntimeException(s);
        }

        return el;
    }
422133
public int read() throws IOException {
    while (true) {
      lockR.lock();
      try {
        if (availableCount.get() > 0) {
          // as long as there is available data
          // serve it even if closed
          int b = bytes[readCursor] & 0xFF;
          incReadCursor(1);
          availableCount.decrementAndGet();
          totalRead++;
          return b;
        } else if (closed){
          // when no bytes are left and buffer is closed
          // return -1
          return -1;
        }
      } finally {
        lockR.unlock();
      }
      sleep(1);
    }
  }
452807
public Reader getReader() {
        // PK33136
        char[] charBuffer = new char[strBuffer.length()] ;
        strBuffer.getChars(0, strBuffer.length(), charBuffer, 0);
        //PK33136
        return (writer == null) ? new CharArrayReader (charBuffer, 0, strBuffer.length()) : null;
    }
345484
public Object read() throws IOException {
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("Reading "+file);
        }
        try (InputStream in = new BufferedInputStream(Files.newInputStream(file.toPath()))) {
            return xs.fromXML(in);
        } catch (RuntimeException | Error e) {
            throw new IOException("Unable to read "+file,e);
        }
    }