text: public static int SerializePtgs(Ptg[] ptgs, byte[] array, int offset){int size = ptgs.Length;LittleEndianByteArrayOutputStream out1 = new LittleEndianByteArrayOutputStream(array, offset);ArrayList arrayPtgs = null;for (int k = 0; k < size; k++){Ptg ptg = ptgs[k];ptg.Write(out1);if (ptg is ArrayPtg){if (arrayPtgs == null){arrayPtgs = new ArrayList(5);}arrayPtgs.Add(ptg);}}if (arrayPtgs != null){for (int i = 0; i < arrayPtgs.Count; i++){ArrayPtg p = (ArrayPtg)arrayPtgs[i];p.WriteTokenValueBytes(out1);}}return out1.WriteIndex - offset; ;}