Package org.jacoco.core.internal

Examples of org.jacoco.core.internal.ContentTypeDetector


   *             if reading data from the stream fails or a class can't be
   *             instrumented
   */
  public int instrumentAll(final InputStream input,
      final OutputStream output, final String name) throws IOException {
    final ContentTypeDetector detector = new ContentTypeDetector(input);
    switch (detector.getType()) {
    case ContentTypeDetector.CLASSFILE:
      instrument(detector.getInputStream(), output, name);
      return 1;
    case ContentTypeDetector.ZIPFILE:
      return instrumentZip(detector.getInputStream(), output, name);
    case ContentTypeDetector.GZFILE:
      return instrumentGzip(detector.getInputStream(), output, name);
    case ContentTypeDetector.PACK200FILE:
      return instrumentPack200(detector.getInputStream(), output, name);
    default:
      copy(detector.getInputStream(), output);
      return 0;
    }
  }
View Full Code Here


   * @throws IOException
   *             if the stream can't be read or a class can't be analyzed
   */
  public int analyzeAll(final InputStream input, final String name)
      throws IOException {
    final ContentTypeDetector detector = new ContentTypeDetector(input);
    switch (detector.getType()) {
    case ContentTypeDetector.CLASSFILE:
      analyzeClass(detector.getInputStream(), name);
      return 1;
    case ContentTypeDetector.ZIPFILE:
      return analyzeZip(detector.getInputStream(), name);
    case ContentTypeDetector.GZFILE:
      return analyzeGzip(detector.getInputStream(), name);
    case ContentTypeDetector.PACK200FILE:
      return analyzePack200(detector.getInputStream(), name);
    default:
      return 0;
    }
  }
View Full Code Here

TOP

Related Classes of org.jacoco.core.internal.ContentTypeDetector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.