* 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;
}
}