Parse the specified readable.

@param readable readable, must not be null
@param listener low-level event based parser callback, must not be null
@throws IOException if an I/O error occurs
435269
public static void parse(final Readable readable, final VcfParseListener listener) throws IOException {
        checkNotNull(readable);
        VcfLineProcessor lineProcessor = new VcfLineProcessor(listener);
        CharStreams.readLines(readable, lineProcessor);
    }
1196592
public void setRuntimeEventListener(RuntimeEventListener listener) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "setRuntimeEventListener", listener);
        _runtimeEventListener = listener;
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "setRuntimeEventListener");
    }
844211
private void readObject(final ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
        @SuppressWarnings("unchecked") // Will throw CCE here if not correct
        final
        L[] srcListeners = (L[]) objectInputStream.readObject();

        this.listeners = new CopyOnWriteArrayList<>(srcListeners);

        @SuppressWarnings("unchecked") // Will throw CCE here if not correct
        final
        Class<L> listenerInterface = (Class<L>) srcListeners.getClass().getComponentType();

        initializeTransientFields(listenerInterface, Thread.currentThread().getContextClassLoader());
    }
639590
public void addListener(final WebAppListener listener) {
		NullArgumentException.validateNotNull(listener, "Listener");
		NullArgumentException.validateNotNull(listener.getListenerClass(),
				"Listener class");
		if (!listeners.contains(listener)) {
			listeners.add(listener);
		}
	}
439783
public static Iterable<HighScoringPair> read(final Readable readable) throws IOException {
        checkNotNull(readable);
        Collect collect = new Collect();
        stream(readable, collect);
        return collect.hsps();
    }
20699
public static void stream(final Readable readable, final BedListener listener) throws IOException {
        checkNotNull(readable);
        checkNotNull(listener);

        BedLineProcessor lineProcessor = new BedLineProcessor(listener);
        CharStreams.readLines(readable, lineProcessor);
    }
96462
public void addListener(ISUPListener listener) {
        if (listener == null) {
            throw new NullPointerException("Listener must not be null!");
        }
        if (this.listeners.contains(listener)) {
            throw new IllegalArgumentException("Listener already present: " + listener + " !");
        } else {
            this.listeners.add(listener);
        }

    }
453766
void read(RecordInput rin, String tag) throws IOException {
    // number of elements
    int numElems = rin.readInt(tag);
    for (int i=0; i<numElems; i++) {
      typeInfos.add(genericReadTypeInfo(rin, tag));
    }
  }
331662
public static void stream(final Readable readable, final VcfStreamListener listener) throws IOException {
        StreamingVcfParser.stream(readable, listener);
    }
1278142
static void parse(final Readable readable, final ParseListener listener)
		throws IOException
	{
		if (readable == null)
		{
			throw new IllegalArgumentException("readable must not be null");
		}
		FastqParserLineProcessor lineProcessor = new FastqParserLineProcessor(listener);
		CharStreams.readLines(readable, lineProcessor);
		if (lineProcessor.getState() == State.COMPLETE)
		{
			listener.complete();
			lineProcessor.setState(State.DESCRIPTION);
		}
		if (lineProcessor.getState() != State.DESCRIPTION)
		{
			throw new IOException("truncated sequence"); // at line " + lineNumber);
		}
	}
1078278
private void parseRequest(CmsUploadListener listener) throws Exception {

        // check if the request is a multipart request
        if (!ServletFileUpload.isMultipartContent(getRequest())) {
            // no multipart request: Abort the upload
            throw new CmsUploadException(m_bundle.key(org.opencms.ade.upload.Messages.ERR_UPLOAD_NO_MULTIPART_0));
        }

        // this was indeed a multipart form request, read the files
        m_multiPartFileItems = readMultipartFileItems(listener);

        // check if there were any multipart file items in the request
        if ((m_multiPartFileItems == null) || m_multiPartFileItems.isEmpty()) {
            // no file items found stop process
            throw new CmsUploadException(m_bundle.key(org.opencms.ade.upload.Messages.ERR_UPLOAD_NO_FILEITEMS_0));
        }

        // there are file items in the request, get the request parameters
        m_parameterMap = CmsRequestUtil.readParameterMapFromMultiPart(
            getCmsObject().getRequestContext().getEncoding(),
            m_multiPartFileItems);

        listener.setFinished(true);
    }
496226
public static void stream(final Readable readable, final HspListener listener) throws IOException {
        checkNotNull(readable);
        checkNotNull(listener);

        HspLineProcessor lineProcessor = new HspLineProcessor(listener);
        CharStreams.readLines(readable, lineProcessor);
    }
138425
public void addListener(final NodeTypeManagerListener listener)
   {
      if (!this.listeners.containsKey(listener))
      {
         this.listeners.put(listener, listener);
      }
   }
573717
public void consumeEvents(Listener listener)
    {
        while (!isEmpty()) {
            Event event = remove();
            event.eventType.fireEvent(listener, event.eventParameters);
        }
    }
136249
public static VcfHeader header(final Readable readable) throws IOException {
        checkNotNull(readable);
        ParseListener parseListener = new ParseListener();
        VcfParser.parse(readable, parseListener);
        return parseListener.getHeader();
    }
414299
@SuppressWarnings("unchecked")
  public static Object parse(String raw) throws IOException {
    JsonReader jr = new JsonReader(new StringReader(raw));
    try {
      return parseRecursive(jr);
    } finally {
      try {
        jr.close();
      } catch (IOException e) {
        logger.log(Level.WARNING, "Failed to close", e);
      }
    }
  }
145688
static void stream(final Readable readable, final FastqVariant variant, final StreamListener listener)
		throws IOException
	{
		if (readable == null)
		{
			throw new IllegalArgumentException("readable must not be null");
		}
		if (variant == null)
		{
			throw new IllegalArgumentException("variant must not be null");
		}
		if (listener == null)
		{
			throw new IllegalArgumentException("listener must not be null");
		}

		final FastqBuilder builder = new FastqBuilder().withVariant(variant);
		FastqParser.parse(readable, new ParseListener()
			{
				@Override
				public void description(final String description) throws IOException
				{
					builder.withDescription(description);
				}

				@Override
				public void sequence(final String sequence) throws IOException
				{
					builder.withSequence(sequence);
				}

				@Override
				public void appendSequence(final String sequence) throws IOException
				{
					builder.appendSequence(sequence);
				}

				@Override
				public void repeatDescription(final String repeatDescription) throws IOException
				{
					String description = builder.getDescription();
					if ((description != null) && (description.length() > 0) && (repeatDescription.length() > 0))
					{
						if (!description.equals(repeatDescription))
						{
							throw new IOException("repeat description must match description");
						}
					}
				}

				/**
				 * Validate the specified quality line.
				 *
				 * @param quality quality line to validate
				 * @throws IOException if an I/O error occurs
				 */
				private void validateQuality(final String quality) throws IOException
				{
					for (int i = 0, size = quality.length(); i < size; i++)
					{
						char c = quality.charAt(i);
						int qualityScore = variant.qualityScore(c);
						if (qualityScore < variant.minimumQualityScore() || qualityScore > variant.maximumQualityScore())
						{
							throw new IOException("quality score must be between " + variant.minimumQualityScore() +
												  " and " + variant.maximumQualityScore() + ", was " + qualityScore +
												  " for ASCII char '" + c + "'");
						}
					}
				}

				@Override
				public void quality(final String quality) throws IOException
				{
					validateQuality(quality);
					builder.withQuality(quality);
				}

				@Override
				public void appendQuality(final String quality) throws IOException
				{
					validateQuality(quality);
					builder.appendQuality(quality);
				}

				@Override
				public void complete() throws IOException
				{
					try
					{
						listener.fastq(builder.build());
					}
					catch (IllegalStateException e)
					{
						throw new IOException("caught an IllegalStateException", e);
					}
				}
			});
	}