values.add(1, values.get(0)); FbxElement dummyProp = new FbxElement(types.length); dummyProp.children = prop.children; dummyProp.id = prop.id;
private static FbxElement readFBXElement(ByteBuffer byteBuffer) throws IOException { long endOffset = getUInt(byteBuffer); if(endOffset == 0) return null; long propCount = getUInt(byteBuffer); getUInt(byteBuffer); // Properties length unused FbxElement element = new FbxElement((int) propCount); element.id = new String(getBytes(byteBuffer, getUByte(byteBuffer))); for(int i = 0; i < propCount; ++i) { char dataType = readDataType(byteBuffer); element.properties.add(readData(byteBuffer, dataType)); element.propertiesTypes[i] = dataType; } if(byteBuffer.position() < endOffset) { while(byteBuffer.position() < (endOffset - BLOCK_SENTINEL_LENGTH)) element.children.add(readFBXElement(byteBuffer)); if(!Arrays.equals(BLOCK_SENTINEL_DATA, getBytes(byteBuffer, BLOCK_SENTINEL_LENGTH))) throw new IOException("Failed to read block sentinel, expected 13 zero bytes"); } if(byteBuffer.position() != endOffset) throw new IOException("Data length not equal to expected"); return element; }
values.add(1, values.get(0)); FbxElement dummyProp = new FbxElement(types.length); dummyProp.children = prop.children; dummyProp.id = prop.id;
private static FbxElement readFBXElement(ByteBuffer byteBuffer) throws IOException { long endOffset = getUInt(byteBuffer); if(endOffset == 0) return null; long propCount = getUInt(byteBuffer); getUInt(byteBuffer); // Properties length unused FbxElement element = new FbxElement((int) propCount); element.id = new String(getBytes(byteBuffer, getUByte(byteBuffer))); for(int i = 0; i < propCount; ++i) { char dataType = readDataType(byteBuffer); element.properties.add(readData(byteBuffer, dataType)); element.propertiesTypes[i] = dataType; } if(byteBuffer.position() < endOffset) { while(byteBuffer.position() < (endOffset - BLOCK_SENTINEL_LENGTH)) element.children.add(readFBXElement(byteBuffer)); if(!Arrays.equals(BLOCK_SENTINEL_DATA, getBytes(byteBuffer, BLOCK_SENTINEL_LENGTH))) throw new IOException("Failed to read block sentinel, expected 13 zero bytes"); } if(byteBuffer.position() != endOffset) throw new IOException("Data length not equal to expected"); return element; }