List of usage examples for com.lowagie.text.pdf RandomAccessFileOrArray InputStreamToArray
public static byte[] InputStreamToArray(InputStream is) throws IOException
From source file:com.qubit.terra.docs.util.FontManager.java
License:Open Source License
protected FontEntry createFontEntry(File ttfFile) throws FontFormatException, IOException, FileNotFoundException, DocumentException { InputStream is = null;/*from w ww .j av a 2s . c o m*/ try { is = new FileInputStream(ttfFile); byte[] fontData = RandomAccessFileOrArray.InputStreamToArray(is); BaseFont baseFont = BaseFont.createFont(ttfFile.getName(), BaseFont.IDENTITY_H, BaseFont.EMBEDDED, false, fontData, null); FontEntry fontEntry = new FontEntry(ttfFile.getName(), baseFont); return fontEntry; } finally { if (is != null) { is.close(); } } }