private static void populateShortBuffer(ShortBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(stream.readShort()); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } System.err.println(""); }
private static void populateIntBuffer(IntBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(stream.readInt()); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateFloatArray(float[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { array[arrayIndex] = readAsFloat(stream, format); arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateByteArray(byte[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { array[arrayIndex] = stream.readByte(); arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateFloatBuffer(FloatBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(readAsFloat(stream, format)); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateShortArray(short[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { if (componentSize == 2) { array[arrayIndex] = stream.readShort(); } else { array[arrayIndex] = stream.readByte(); } arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateVector3fArray(Vector3f[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { array[arrayIndex] = new Vector3f( readAsFloat(stream, format), readAsFloat(stream, format), readAsFloat(stream, format) ); arrayIndex++; if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateQuaternionArray(Quaternion[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { array[arrayIndex] = new Quaternion( readAsFloat(stream, format), readAsFloat(stream, format), readAsFloat(stream, format), readAsFloat(stream, format) ); arrayIndex++; if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateFloatArray(float[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { array[arrayIndex] = readAsFloat(stream, format); arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateIntBuffer(IntBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(stream.readInt()); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateFloatBuffer(FloatBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(readAsFloat(stream, format)); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateShortBuffer(ShortBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(stream.readShort()); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } System.err.println(""); }
private static void populateByteArray(byte[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { array[arrayIndex] = stream.readByte(); arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateShortArray(short[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { if (componentSize == 2) { array[arrayIndex] = stream.readShort(); } else { array[arrayIndex] = stream.readByte(); } arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateVector3fArray(Vector3f[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { array[arrayIndex] = new Vector3f( readAsFloat(stream, format), readAsFloat(stream, format), readAsFloat(stream, format) ); arrayIndex++; if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateQuaternionArray(Quaternion[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { array[arrayIndex] = new Quaternion( readAsFloat(stream, format), readAsFloat(stream, format), readAsFloat(stream, format), readAsFloat(stream, format) ); arrayIndex++; if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
in.skipBytes(remaining);
int skipped = in.skipBytes(len); if (skipped <= 0) { return null;