/** * Convert an Exception into an unchecked exception. Return the exception if it is * already an unchecked exception or return an ExceptionConverter wrapper otherwise * * @param ex the exception to convert * @return an unchecked exception * @since 2.1.6 */ public static final RuntimeException convertException(Exception ex) { if (ex instanceof RuntimeException) { return (RuntimeException) ex; } return new ExceptionConverter(ex); }
/** we have to override this as well */ public void printStackTrace() { printStackTrace(System.err); }
/** * Convert an Exception into an unchecked exception. Return the exception if it is * already an unchecked exception or return an ExceptionConverter wrapper otherwise * * @param ex the exception to convert * @return an unchecked exception * @since 2.1.6 */ public static final RuntimeException convertException(Exception ex) { if (ex instanceof RuntimeException) { return (RuntimeException) ex; } return new ExceptionConverter(ex); }
/** 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); } }
/** * Write out the string just uncompressed. */ public void writeString(byte string[]) { try { uncompData.write(string); } catch (IOException e) { throw new ExceptionConverter(e); } }
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 void fillXfaForm(InputSource is, boolean readOnly) throws IOException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; try { db = dbf.newDocumentBuilder(); Document newdoc = db.parse(is); fillXfaForm(newdoc.getDocumentElement(), readOnly); } catch (ParserConfigurationException e) { throw new ExceptionConverter(e); } catch (SAXException e) { throw new ExceptionConverter(e); } }
char getCard16() { try { return buf.readChar(); } catch (Exception e) { throw new ExceptionConverter(e); } }
void seek(int offset) { try { buf.seek(offset); } catch (Exception e) { throw new ExceptionConverter(e); } }
int getPosition() { try { return (int)buf.getFilePointer(); } catch (Exception e) { throw new ExceptionConverter(e); } } int nextIndexOffset;
public static ICC_Profile getInstance(byte[] data) { try { Integer cs; cs = cstags.get(new String(data, 16, 4, "US-ASCII")); int numComponents = cs == null ? 0 : cs.intValue(); return getInstance(data, numComponents); } catch (UnsupportedEncodingException e) { throw new ExceptionConverter(e); } }
char getCard8() { try { byte i = buf.readByte(); return (char)(i & 0xff); } catch (Exception e) { throw new ExceptionConverter(e); } }
int getInt() { try { return buf.readInt(); } catch (Exception e) { throw new ExceptionConverter(e); } }
/** Gets the page label dictionary to insert into the document. * @return the page label dictionary */ public PdfDictionary getDictionary(PdfWriter writer) { try { return PdfNumberTree.writeTree(map, writer); } catch (IOException e) { throw new ExceptionConverter(e); } }
int getInt() { try { return buf.readInt(); } catch (Exception e) { throw new ExceptionConverter(e); } }
/** * Flushes the <CODE>BufferedOutputStream</CODE>. */ public void flush() { try { os.flush(); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }