/** * Read one single Card8 value from the buffer. * @return the card8 value * @throws IOException if an error occurs during reading */ public int readCard8() throws IOException { return readUnsignedByte(); }
/** * Read the offsize from the buffer. * @return the offsize * @throws IOException if an error occurs during reading */ public int readOffSize() throws IOException { return readUnsignedByte(); }
/** * Read the offset from the buffer. * @param offSize the given offsize * @return the offset * @throws IOException if an error occurs during reading */ public int readOffset(int offSize) throws IOException { int value = 0; for (int i = 0; i < offSize; i++) { value = value << 8 | readUnsignedByte(); } return value; }
private static Integer readIntegerNumber(CFFDataInput input, int b0) throws IOException { if (b0 == 28) { return (int) input.readShort(); } else if (b0 == 29) { return input.readInt(); } else if (b0 >= 32 && b0 <= 246) { return b0 - 139; } else if (b0 >= 247 && b0 <= 250) { int b1 = input.readUnsignedByte(); return (b0 - 247) * 256 + b1 + 108; } else if (b0 >= 251 && b0 <= 254) { int b1 = input.readUnsignedByte(); return -(b0 - 251) * 256 - b1 - 108; } else { throw new IllegalArgumentException(); } }
private static CFFOperator.Key readOperatorKey(CFFDataInput input, int b0) throws IOException { if (b0 == 12) { int b1 = input.readUnsignedByte(); return new CFFOperator.Key(b0, b1); } return new CFFOperator.Key(b0); }
while (!done) int b = input.readUnsignedByte(); int[] nibbles = { b / 16, b % 16 }; for (int nibble : nibbles)
private static DictData.Entry readEntry(CFFDataInput input) throws IOException { DictData.Entry entry = new DictData.Entry(); while (true) { int b0 = input.readUnsignedByte(); if (b0 >= 0 && b0 <= 21) { entry.operator = readOperator(input, b0); break; } else if (b0 == 28 || b0 == 29) { entry.operands.add(readIntegerNumber(input, b0)); } else if (b0 == 30) { entry.operands.add(readRealNumber(input, b0)); } else if (b0 >= 32 && b0 <= 254) { entry.operands.add(readIntegerNumber(input, b0)); } else { throw new IOException("invalid DICT data b0 byte: " + b0); } } return entry; }
/** * Read the offsize from the buffer. * @return the offsize * @throws IOException if an error occurs during reading */ public int readOffSize() throws IOException { return readUnsignedByte(); }
/** * Read one single Card8 value from the buffer. * @return the card8 value * @throws IOException if an error occurs during reading */ public int readCard8() throws IOException { return readUnsignedByte(); }
/** * Read one single Card8 value from the buffer. * @return the card8 value * @throws IOException if an error occurs during reading */ public int readCard8() throws IOException { return readUnsignedByte(); }
/** * Read the offsize from the buffer. * @return the offsize * @throws IOException if an error occurs during reading */ public int readOffSize() throws IOException { return readUnsignedByte(); }
/** * Read the offset from the buffer. * @param offSize the given offsize * @return the offset * @throws IOException if an error occurs during reading */ public int readOffset(int offSize) throws IOException { int value = 0; for (int i = 0; i < offSize; i++) { value = value << 8 | readUnsignedByte(); } return value; }
/** * Read the offset from the buffer. * @param offSize the given offsize * @return the offset * @throws IOException if an error occurs during reading */ public int readOffset(int offSize) throws IOException { int value = 0; for (int i = 0; i < offSize; i++) { value = value << 8 | readUnsignedByte(); } return value; }
private static Integer readIntegerNumber(CFFDataInput input, int b0) throws IOException { if (b0 == 28) { return (int) input.readShort(); } else if (b0 == 29) { return input.readInt(); } else if (b0 >= 32 && b0 <= 246) { return b0 - 139; } else if (b0 >= 247 && b0 <= 250) { int b1 = input.readUnsignedByte(); return (b0 - 247) * 256 + b1 + 108; } else if (b0 >= 251 && b0 <= 254) { int b1 = input.readUnsignedByte(); return -(b0 - 251) * 256 - b1 - 108; } else { throw new IllegalArgumentException(); } }
private static Integer readIntegerNumber(CFFDataInput input, int b0) throws IOException { if (b0 == 28) { return (int) input.readShort(); } else if (b0 == 29) { return input.readInt(); } else if (b0 >= 32 && b0 <= 246) { return b0 - 139; } else if (b0 >= 247 && b0 <= 250) { int b1 = input.readUnsignedByte(); return (b0 - 247) * 256 + b1 + 108; } else if (b0 >= 251 && b0 <= 254) { int b1 = input.readUnsignedByte(); return -(b0 - 251) * 256 - b1 - 108; } else { throw new IllegalArgumentException(); } }
private static CFFOperator.Key readOperatorKey(CFFDataInput input, int b0) throws IOException { if (b0 == 12) { int b1 = input.readUnsignedByte(); return new CFFOperator.Key(b0, b1); } return new CFFOperator.Key(b0); }
private static CFFOperator.Key readOperatorKey(CFFDataInput input, int b0) throws IOException { if (b0 == 12) { int b1 = input.readUnsignedByte(); return new CFFOperator.Key(b0, b1); } return new CFFOperator.Key(b0); }
while (!done) int b = input.readUnsignedByte(); int[] nibbles = { b / 16, b % 16 }; for (int nibble : nibbles)
private static DictData.Entry readEntry(CFFDataInput input) throws IOException { DictData.Entry entry = new DictData.Entry(); while (true) { int b0 = input.readUnsignedByte(); if (b0 >= 0 && b0 <= 21) { entry.operator = readOperator(input, b0); break; } else if (b0 == 28 || b0 == 29) { entry.operands.add(readIntegerNumber(input, b0)); } else if (b0 == 30) { entry.operands.add(readRealNumber(input, b0)); } else if (b0 >= 32 && b0 <= 254) { entry.operands.add(readIntegerNumber(input, b0)); } else { throw new IOException("invalid DICT data b0 byte: " + b0); } } return entry; }
private static DictData.Entry readEntry(CFFDataInput input) throws IOException { DictData.Entry entry = new DictData.Entry(); while (true) { int b0 = input.readUnsignedByte(); if (b0 >= 0 && b0 <= 21) { entry.operator = readOperator(input, b0); break; } else if (b0 == 28 || b0 == 29) { entry.operands.add(readIntegerNumber(input, b0)); } else if (b0 == 30) { entry.operands.add(readRealNumber(input, b0)); } else if (b0 >= 32 && b0 <= 254) { entry.operands.add(readIntegerNumber(input, b0)); } else { throw new IOException("invalid DICT data b0 byte: " + b0); } } return entry; }