/** Resets the example file stream to the beginning. */ public void reset() { close(); try { if (exampleFileName != null) { if (zipped) { ZipFile zip = new ZipFile(exampleFileName); in = new DataInputStream(new BufferedInputStream(zip.getInputStream(zip .getEntry(ExceptionlessInputStream.zipEntryName)))); } else in = new DataInputStream(new BufferedInputStream(new FileInputStream( exampleFileName))); } else if (zipped) { ZipInputStream zip = new ZipInputStream(new ByteArrayInputStream(exampleData)); zip.getNextEntry(); in = new DataInputStream(new BufferedInputStream(zip)); } else in = new DataInputStream(new ByteArrayInputStream(exampleData)); } catch (Exception e) { System.err.println("Can't open '" + exampleFileName + "' for input:"); e.printStackTrace(); System.exit(1); } }