public int getMarshalledSize() { int marshalSize = 0; marshalSize = super.getMarshalledSize(); marshalSize = marshalSize + entityId.getMarshalledSize(); // entityId marshalSize = marshalSize + 2; // communicationsDeviceID marshalSize = marshalSize + 2; // encodingScheme marshalSize = marshalSize + 2; // tdlType marshalSize = marshalSize + 4; // sampleRate marshalSize = marshalSize + 2; // dataLength marshalSize = marshalSize + 2; // samples for (int idx = 0; idx < data.size(); idx++) { OneByteChunk listElement = data.get(idx); marshalSize = marshalSize + listElement.getMarshalledSize(); } return marshalSize; }