Creates an InputReader
@param in
@param shared Shared ringbuffer.
@return
551589
public static InputReader getInstance(Reader in, char[] shared)
    {
        Set<ParserFeature> features = NO_FEATURES;
        return new ReadableInput(getFeaturedReader(in, shared.length, features), shared, features);
    }
638145
public List<Process> read(final InputSource in) throws SAXException,
                                                  IOException {
        this.processes = ((ProcessBuildData)this.parser.read( in )).getProcesses();
        return this.processes;
    }
804217
public static BufferedInputStream toBuffered(InputStream in) {
		return (in instanceof BufferedInputStream) ? (BufferedInputStream) in : new BufferedInputStream(in);
	}
417477
public static String readInputStreamBufferedAsString(final InputStream in, final String charset) throws IOException {
		BufferedReader reader = null;
		try {
			reader = new BufferedReader(new UnicodeReader(in, charset));
			StringBuilder result = new StringBuilder();
			char[] cbuf = new char[2048];
			int read;
			while ((read = reader.read(cbuf)) > 0)
				result.append(cbuf, 0, read);
			return result.toString();
		} finally {
			closeIgnoringException(reader);
		}

	}
483052
@Override
  @SuppressWarnings("unchecked")
  public D read(D reuse, Decoder in) throws IOException {    
    resolver.configure(in);
    D result = (D) read(reuse, getExpected(), resolver);
    resolver.drain();
    return result;
  }
1194136
public void load(Reader in) {
		try {
			doLoad(in);
		} catch (Exception e) {
			throw Exceptions.propagate(e);
		}
	}
780023
public static int readn ( InputStream in, byte[] b, int off, int len ) throws IOException {
        int i = 0, n = -5;

        if ( off + len > b.length ) {
            throw new IOException("Buffer too short, bufsize " + b.length + " read " + len);
        }

        while ( i < len ) {
            n = in.read(b, off + i, len - i);
            if ( n <= 0 ) {
                break;
            }
            i += n;
        }

        return i;
    }
1259592
private static BufferedReader bufferInput( Reader reader )
    {
        BufferedReader in;
        if( reader instanceof BufferedReader )
        {
            in = (BufferedReader) reader;
        }
        else
        {
            in = new BufferedReader( reader );
        }
        return in;
    }
1034323
@SuppressWarnings("unchecked")
	private void initInputReaders() throws Exception {
		int numGates = 0;
		//  ---------------- create the input readers ---------------------
		// in case where a logical input unions multiple physical inputs, create a union reader
		final int groupSize = this.config.getGroupSize(0);
		numGates += groupSize;
		if (groupSize == 1) {
			// non-union case
			inputReader = new MutableRecordReader<DeserializationDelegate<IT>>(
					getEnvironment().getInputGate(0),
					getEnvironment().getTaskManagerInfo().getTmpDirectories());
		} else if (groupSize > 1){
			// union case
			inputReader = new MutableRecordReader<IOReadableWritable>(
					new UnionInputGate(getEnvironment().getAllInputGates()),
					getEnvironment().getTaskManagerInfo().getTmpDirectories());
		} else {
			throw new Exception("Illegal input group size in task configuration: " + groupSize);
		}
		
		this.inputTypeSerializerFactory = this.config.getInputSerializer(0, getUserCodeClassLoader());
		@SuppressWarnings({ "rawtypes" })
		final MutableObjectIterator<?> iter = new ReaderIterator(inputReader, this.inputTypeSerializerFactory.getSerializer());
		this.reader = (MutableObjectIterator<IT>)iter;

		// final sanity check
		if (numGates != this.config.getNumInputs()) {
			throw new Exception("Illegal configuration: Number of input gates and group sizes are not consistent.");
		}
	}
212632
public <T> T read(final String input, Class<T> rootType) {
        return read(new StringReader(input), rootType);
    }
661355
public EventReader createReader() {
        return new EventReader(eventsProcessor, sourceFilter, eventFilter, progressReporter, exceptionHandler, sqsManager, s3Manager, config);
    }
975187
public static <T> InputReader getInstance(T input, int size, Set<ParserFeature> features) throws IOException
    {
        return getInstance(input, size, UTF_8, features);
    }
192124
protected Reader _createReader(InputStream in, JsonEncoding enc, IOContext ctxt) throws IOException
    {
        if (enc == null) {
            enc = JsonEncoding.UTF8;
        }
        // default to UTF-8 if encoding missing
        if (enc == JsonEncoding.UTF8) {
            boolean autoClose = ctxt.isResourceManaged() || isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE);
            return new UTF8Reader(in, autoClose);
        }
        return new InputStreamReader(in, enc.getJavaName());
    }
294028
public TreeReader newTreeReader(Reader in) {
    if (discardFrags) {
      return new FragDiscardingPennTreeReader(in, new LabeledScoredTreeFactory(), tn, new CHTBTokenizer(in));
    } else {
      return new PennTreeReader(in, new LabeledScoredTreeFactory(), tn, new CHTBTokenizer(in));
    }
  }
996309
public static FastByteArrayOutputStream read(InputStream in) throws IORuntimeException {
		final FastByteArrayOutputStream out = new FastByteArrayOutputStream();
		copy(in, out);
		return out;
	}
69706
protected InterleavedInputStream createInterleavedInputStream(InputStream in,
      int metaDataBlockLength, int dataBlockLength,
      SimpleSeekableFormat.MetaDataConsumer consumer) {
    return new InterleavedInputStream(in, metaDataBlockLength, dataBlockLength, consumer);
  }
851584
@Override
    public RecordReader createReader(InputSplit split) throws IOException, InterruptedException {
        RecordReader reader = new ListStringRecordReader();
        reader.initialize(split);
        return reader;
    }