/** * Write out the string just uncompressed. */ public void writeString(byte string[]) { try { uncompData.write(string); } catch (IOException e) { throw new ExceptionConverter(e); } }
/** we have to override this as well */ public void printStackTrace() { printStackTrace(System.err); }
/** * Write out the string just uncompressed. */ public void writeString(byte string[]) { try { uncompData.write(string); } catch (IOException e) { throw new ExceptionConverter(e); } }
/** we have to override this as well */ public void printStackTrace() { printStackTrace(System.err); }
/** * Write out the string just uncompressed. */ public void writeString(byte[] string) { try { uncompData.write(string); } catch (IOException e) { throw new ExceptionConverter(e); } }
/** we have to override this as well */ public void printStackTrace() { printStackTrace(System.err); }
public static void inflate(byte[] deflated, byte[] inflated) { Inflater inflater = new Inflater(); inflater.setInput(deflated); try { inflater.inflate(inflated); } catch(DataFormatException dfe) { throw new ExceptionConverter(dfe); } }
public static void inflate(byte[] deflated, byte[] inflated) { Inflater inflater = new Inflater(); inflater.setInput(deflated); try { inflater.inflate(inflated); } catch(DataFormatException dfe) { throw new ExceptionConverter(dfe); } }
public static byte[] createDocumentId() { MessageDigest md5; try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { throw new ExceptionConverter(e); } long time = System.currentTimeMillis(); long mem = Runtime.getRuntime().freeMemory(); String s = time + "+" + mem + "+" + (seq++); return md5.digest(s.getBytes()); }
public static byte[] createDocumentId() { MessageDigest md5; try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { throw new ExceptionConverter(e); } long time = System.currentTimeMillis(); long mem = Runtime.getRuntime().freeMemory(); String s = time + "+" + mem + "+" + (seq++); return md5.digest(s.getBytes()); }
public static byte[] createDocumentId() { MessageDigest md5; try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { throw new ExceptionConverter(e); } long time = System.currentTimeMillis(); long mem = Runtime.getRuntime().freeMemory(); String s = time + "+" + mem + "+" + (seq++); return md5.digest(s.getBytes()); }
public static Image getGifImage(URL url) { try { InputStream is = url.openStream(); BufferedImage bufferedImage = ImageIO.read(is); is.close(); return Image.getInstance(bufferedImage, null, false); } catch (Exception e) { throw new ExceptionConverter(e); } }
public static Image getGifImage(byte[] imageData) { try { BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(imageData)); return Image.getInstance(bufferedImage, null, false); } catch (Exception e) { throw new ExceptionConverter(e); } }
/** * Gets the page label dictionary to insert into the document. * * @return the page label dictionary */ PdfDictionary getDictionary(PdfWriter writer) { try { return PdfNumberTree.writeTree(map, writer); } catch (IOException e) { throw new ExceptionConverter(e); } }
PdfIndirectReference addPageRef(PdfIndirectReference pageRef) { try { if ((pages.size() % leafSize) == 0) parents.add(writer.getPdfIndirectReference()); pages.add(pageRef); return (PdfIndirectReference)parents.get(parents.size() - 1); } catch (Exception e) { throw new ExceptionConverter(e); } }
short getShort() { try { return buf.readShort(); } catch (Exception e) { throw new ExceptionConverter(e); } }
protected void init(InputStream in) { try { SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(new InputSource(in), new AttributeHandler(this)); } catch(Exception e) { throw new ExceptionConverter(e); } }
protected void init(InputStream in) { try { SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(new InputSource(in), new AttributeHandler(this)); } catch(Exception e) { throw new ExceptionConverter(e); } }
/** Gets the number of pages the TIFF document has. * @param s the file source * @return the number of pages */ public static int getNumberOfPages(RandomAccessFileOrArray s) { try { return TIFFDirectory.getNumDirectories(s); } catch (Exception e) { throw new ExceptionConverter(e); } }
public PdfEncryption() { try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { throw new ExceptionConverter(e); } publicKeyHandler = new PdfPublicKeySecurityHandler(); }