text: public static int serializePtgs(Ptg[] ptgs, byte[] array, int offset) {LittleEndianByteArrayOutputStream out = new LittleEndianByteArrayOutputStream(array, offset); List<Ptg> arrayPtgs = null;for (Ptg ptg : ptgs) {ptg.write(out);if (ptg instanceof ArrayPtg) {if (arrayPtgs == null) {arrayPtgs = new ArrayList<>(5);}arrayPtgs.add(ptg);}}if (arrayPtgs != null) {for (Ptg arrayPtg : arrayPtgs) {ArrayPtg p = (ArrayPtg) arrayPtg;p.writeTokenValueBytes(out);}}return out.getWriteIndex() - offset;}