@Override
    public void deserialize(Buffer buf) {
        bonesId = buf.readShort();
        if (bonesId < 0)
            throw new RuntimeException("Forbidden value on bonesId = " + bonesId + ", it doesn't respect the following condition : bonesId < 0");
        int limit = buf.readUShort();
        skins = new short[limit];
        for (int i = 0; i < limit; i++) {
            skins[i] = buf.readShort();
        }
        limit = buf.readUShort();
        indexedColors = new int[limit];
        for (int i = 0; i < limit; i++) {
            indexedColors[i] = buf.readInt();
        }
        limit = buf.readUShort();
        scales = new short[limit];
        for (int i = 0; i < limit; i++) {
            scales[i] = buf.readShort();
        }
        limit = buf.readUShort();
        subentities = new SubEntity[limit];
        for (int i = 0; i < limit; i++) {
            subentities[i] = new SubEntity();
            subentities[i].deserialize(buf);
        }
    }