1 18 package org.apache.batik.svggen.font.table; 19 20 import java.io.ByteArrayInputStream ; 21 import java.io.IOException ; 22 import java.io.RandomAccessFile ; 23 24 28 public abstract class Program { 29 30 private short[] instructions; 31 32 public short[] getInstructions() { 33 return instructions; 34 } 35 36 protected void readInstructions(RandomAccessFile raf, int count) throws IOException { 37 instructions = new short[count]; 38 for (int i = 0; i < count; i++) { 39 instructions[i] = (short) raf.readUnsignedByte(); 40 } 41 } 42 43 protected void readInstructions(ByteArrayInputStream bais, int count) { 44 instructions = new short[count]; 45 for (int i = 0; i < count; i++) { 46 instructions[i] = (short) bais.read(); 47 } 48 } 49 } 50 | Popular Tags |