* Serializes this constant pool into a byte array. The serialization format
* is according to the java class file format.
* @return this constant pool as a byte array.
*/
public byte[] getData() {
ByteSerializer ser = new ByteSerializer(true);
ser.addShort(size());
for (int i = 1; i < size(); i++) {
ConstantPoolInfo cpi = get(i);
ser.addBytes(cpi.getData());
// 2 word(8 byte) types take up 2 indices
if (cpi.getType() == ConstantPoolInfo.LONG
|| cpi.getType() == ConstantPoolInfo.DOUBLE) {
i++;
}
}
return ser.getBytes();
}