@Override
    public void write(JmeExporter exporter) throws IOException {
        super.write(exporter);
        OutputCapsule capsule = exporter.getCapsule(this);

        capsule.write(numConnections, "numConnections", 1);
        capsule.write(skeleton, "skeleton", null);

        if (boneLengths != null) {
            int numLengths = boneLengths.size();
            int[] blKeys = new int[numLengths];
            float[] blValues = new float[numLengths];
            int i = 0;
            for (Map.Entry<Integer, Float> entry : boneLengths.entrySet()) {
                blKeys[i] = entry.getKey();
                blValues[i] = entry.getValue();
                ++i;
            }
            capsule.write(blKeys, "blKeys", null);
            capsule.write(blValues, "blValues", null);
        }
    }
Serializes to the specified exporter, for example when saving to a J3O
file. The current instance is unaffected.

@param exporter the exporter to use (not null)
@throws IOException from the exporter
jme3-core/src/main/java/com/jme3/scene/debug/SkeletonWire.java