public void writeConformance(NetworkDataRepresentation ndr) { int[] conformance = getConformance(); int dimensions = conformance.length; for (int i = 0; i < dimensions; i++) { ndr.writeUnsignedLong(conformance[i]); } ArrayHelper helper = getHelper(); if (ConformantVaryingString.class.isAssignableFrom(helper.getType())) { ConformantVaryingString string = (ConformantVaryingString) ((ElementHelper) helper).getTemplate(); ndr.writeUnsignedLong(string.getConformance()); } }
public void readConformance(NetworkDataRepresentation ndr) { int[] conformance = getConformance(); int dimensions = conformance.length; boolean redim = false; int length; for (int i = 0; i < dimensions; i++) { if ((length = (int) ndr.readUnsignedLong()) != conformance[i]) { conformance[i] = length; redim = true; } } ArrayHelper helper = getHelper(); if (redim) { setArray(Array.newInstance(helper.getType(), conformance)); } if (ConformantVaryingString.class.isAssignableFrom(helper.getType())) { ConformantVaryingString string = (ConformantVaryingString) ((ElementHelper) helper).getTemplate(); string.setConformance((int) ndr.readUnsignedLong()); } }