@Override
    public ArrayList<ByteBuffer> readByteBufferArrayList(String name, ArrayList<ByteBuffer> defVal) throws IOException {
        byte[][] byteArray2D = readByteArray2D(name, null);

        if (byteArray2D == null) {
            return defVal;
        }

        ArrayList<ByteBuffer> byteBufferList = new ArrayList<>(byteArray2D.length);
        for (byte[] byteArray : byteArray2D) {
            if (byteArray == null) {
                byteBufferList.add(null);
            } else {
                byteBufferList.add((ByteBuffer) BufferUtils.createByteBuffer(byteArray.length).put(byteArray).rewind());
            }
        }

        return byteBufferList;
    }
Part of the jME XML IO system as introduced in the Google Code jmexml project.

@author Kai Rabien (hevee) - original author of the code.google.com jmexml project
@author Doug Daniels (dougnukem) - adjustments for jME 2.0 and Java 1.5
@author blaine
jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java