/** * {@inheritDoc} */ public void readFully(byte b[]) throws java.io.IOException { readFully(b, 0, b.length); }
/** * {@inheritDoc} */ public void readFully(byte b[]) throws java.io.IOException { readFully(b, 0, b.length); }
public void readFully(byte[] bytes) throws java.io.IOException { file.readFully(bytes); }
public void readFully(byte[] bytes) throws java.io.IOException { file.readFully(bytes); }
private String readString(int n) throws java.io.IOException { byte[] b = new byte[n]; input.readFully(b); int k; for (k = 0; k < b.length; ++k) { if (b[k] == 0) break; } return new String(b, 0, k, "ISO-8859-1"); }
private String readString(int n) throws java.io.IOException { byte[] b = new byte[n]; input.readFully(b); int k; for (k = 0; k < b.length; ++k) { if (b[k] == 0) break; } return new String(b, 0, k, "ISO-8859-1"); }
/** * Reads a {@code String} from the font file as bytes using the given encoding. * * @param length the length of bytes to read * @param encoding the given encoding * @return the {@code String} read * @throws java.io.IOException the font file could not be read */ public String readString(int length, String encoding) throws java.io.IOException { byte[] buf = new byte[length]; readFully(buf); return new String(buf, encoding); }
/** * Reads a {@code String} from the font file as bytes using the given encoding. * * @param length the length of bytes to read * @param encoding the given encoding * @return the {@code String} read * @throws java.io.IOException the font file could not be read */ public String readString(int length, String encoding) throws java.io.IOException { byte[] buf = new byte[length]; readFully(buf); return new String(buf, encoding); }
/** * Reads a {@code String} from the font file as bytes using the Cp1252 encoding. * * @param length the length of bytes to read * @return the {@code String} read * @throws java.io.IOException the font file could not be read */ protected String readStandardString(int length) throws java.io.IOException { byte[] buf = new byte[length]; rf.readFully(buf); try { return new String(buf, PdfEncodings.WINANSI); } catch (Exception e) { throw new IOException("TrueType font", e); } }
/** * Reads a {@code String} from the font file as bytes using the Cp1252 encoding. * * @param length the length of bytes to read * @return the {@code String} read * @throws java.io.IOException the font file could not be read */ protected String readStandardString(int length) throws java.io.IOException { byte[] buf = new byte[length]; rf.readFully(buf); try { return new String(buf, PdfEncodings.WINANSI); } catch (Exception e) { throw new IOException("TrueType font", e); } }
if (len > 0) { rf.seek(tableGlyphOffset + start); rf.readFully(newGlyfTable, glyfPtr, len); glyfPtr += len;
if (len > 0) { rf.seek(tableGlyphOffset + start); rf.readFully(newGlyfTable, glyfPtr, len); glyfPtr += len;
buf.readFully(NewObjects, start + unusedOffset, end - start); } else { NewObjects[start + unusedOffset] = OperatorForUnusedEntries;
public byte[] getFullFont() throws java.io.IOException { RandomAccessFileOrArray rf2 = null; try { rf2 = raf.createView(); byte[] b = new byte[(int) rf2.length()]; rf2.readFully(b); return b; } finally { try { if (rf2 != null) { rf2.close(); } } catch (Exception ignored) { } } }
public byte[] getFullFont() throws java.io.IOException { RandomAccessFileOrArray rf2 = null; try { rf2 = raf.createView(); byte[] b = new byte[(int) rf2.length()]; rf2.readFully(b); return b; } finally { try { if (rf2 != null) { rf2.close(); } } catch (Exception ignored) { } } }
buf.readFully(NewObjects, start + unusedOffset, end - start); } else { NewObjects[start + unusedOffset] = OperatorForUnusedEntries;
/** * If this font file is using the Compact Font File Format, then this method * will return the raw bytes needed for the font stream. If this method is * ever made public: make sure to add a test if (cff == true). * * @return a byte array */ public byte[] readCffFont() throws java.io.IOException { if (!isCff()) { return null; } RandomAccessFileOrArray rf2 = null; try { rf2 = raf.createView(); rf2.seek(cffOffset); byte[] cff = new byte[cffLength]; rf2.readFully(cff); return cff; } finally { try { if (rf2 != null) { rf2.close(); } } catch (Exception ignored) { } } }
/** * If this font file is using the Compact Font File Format, then this method * will return the raw bytes needed for the font stream. If this method is * ever made public: make sure to add a test if (cff == true). * * @return a byte array */ public byte[] readCffFont() throws java.io.IOException { if (!isCff()) { return null; } RandomAccessFileOrArray rf2 = null; try { rf2 = raf.createView(); rf2.seek(cffOffset); byte[] cff = new byte[cffLength]; rf2.readFully(cff); return cff; } finally { try { if (rf2 != null) { rf2.close(); } } catch (Exception ignored) { } } }
static byte[] readFontBytesFromPath(String path) throws java.io.IOException { RandomAccessFileOrArray raf = new RandomAccessFileOrArray(new RandomAccessSourceFactory().createBestSource(path)); int bufLen = (int) raf.length(); if (bufLen < raf.length()) { throw new IOException(MessageFormatUtil.format("Source data from \"{0}\" is bigger than byte array can hold.", path)); } byte[] buf = new byte[bufLen]; raf.readFully(buf); return buf; } }
static byte[] readFontBytesFromPath(String path) throws java.io.IOException { RandomAccessFileOrArray raf = new RandomAccessFileOrArray(new RandomAccessSourceFactory().createBestSource(path)); int bufLen = (int) raf.length(); if (bufLen < raf.length()) { throw new IOException(MessageFormatUtil.format("Source data from \"{0}\" is bigger than byte array can hold.", path)); } byte[] buf = new byte[bufLen]; raf.readFully(buf); return buf; } }