/** * Get the data in this map as a ByteBuffer */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(262); buf.putShort(getFormat()); buf.putShort(getLength()); buf.putShort(getLanguage()); buf.put(getMap()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** * Cannot map from short */ public char map(char src) { if (src < 0 || src > 255) { // out of range return (char) 0; } return (char) (map((byte) src) & 0xff); }
/** Creates a new instance of CMapFormat0 */ protected CMapFormat0(short language) { super((short) 0, language); byte[] initialIndex = new byte[256]; for (int i = 0; i < initialIndex.length; i++) { initialIndex[i] = (byte) i; } setMap(initialIndex); }
outMap = new CMapFormat0 (language); break; case 4: // CMap format 4 - two byte encoding
outMap = new CMapFormat0 (language); break; case 4: // CMap format 4 - two byte encoding
/** * Get the data in this map as a ByteBuffer */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(262); buf.putShort(getFormat()); buf.putShort(getLength()); buf.putShort(getLanguage()); buf.put(getMap()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** Creates a new instance of CMapFormat0 */ protected CMapFormat0(short language) { super((short) 0, language); byte[] initialIndex = new byte[256]; for (int i = 0; i < initialIndex.length; i++) { initialIndex[i] = (byte) i; } setMap(initialIndex); }
/** * Cannot map from short */ public char map(char src) { if (src < 0 || src > 255) { // out of range return (char) 0; } return (char) (map((byte) src) & 0xff); }
outMap = new CMapFormat0 (language); break; case 4: // CMap format 4 - two byte encoding
/** * Get the data in this map as a ByteBuffer */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(262); buf.putShort(getFormat()); buf.putShort(getLength()); buf.putShort(getLanguage()); buf.put(getMap()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** Creates a new instance of CMapFormat0 */ protected CMapFormat0(short language) { super((short) 0, language); byte[] initialIndex = new byte[256]; for (int i = 0; i < initialIndex.length; i++) { initialIndex[i] = (byte) i; } setMap(initialIndex); }
/** * Cannot map from short */ public char map(char src) { if (src < 0 || src > 255) { // out of range return (char) 0; } return (char) (map((byte) src) & 0xff); }
/** * Read the map in from a byte buffer */ public void setData(int length, ByteBuffer data) { if (length != 262) { throw new IllegalArgumentException("Bad length for CMap format 0"); } if (data.remaining() != 256) { throw new IllegalArgumentException("Wrong amount of data for CMap format 0"); } byte[] map = new byte[256]; data.get(map); setMap(map); } }
short value = (short) (zeroMap.map ((byte) i) & 0xff); if (value != 0) { fourMap.addSegment ((short) i, (short) i,
/** * Read the map in from a byte buffer */ public void setData(int length, ByteBuffer data) { if (length != 262) { throw new IllegalArgumentException("Bad length for CMap format 0"); } if (data.remaining() != 256) { throw new IllegalArgumentException("Wrong amount of data for CMap format 0"); } byte[] map = new byte[256]; data.get(map); setMap(map); } }
short value = (short) (zeroMap.map ((byte) i) & 0xff); if (value != 0) { fourMap.addSegment ((short) i, (short) i,
/** * Read the map in from a byte buffer */ public void setData(int length, ByteBuffer data) { if (length != 262) { throw new IllegalArgumentException("Bad length for CMap format 0"); } if (data.remaining() != 256) { throw new IllegalArgumentException("Wrong amount of data for CMap format 0"); } byte[] map = new byte[256]; data.get(map); setMap(map); } }
short value = (short) (zeroMap.map ((byte) i) & 0xff); if (value != 0) { fourMap.addSegment ((short) i, (short) i,
newMap.setMap(map);