3636import com .jme3 .plugins .json .JsonObject ;
3737import com .jme3 .asset .AssetInfo ;
3838import com .jme3 .asset .AssetLoadException ;
39+ import com .jme3 .export .binary .ByteUtils ;
3940import com .jme3 .math .*;
4041import com .jme3 .plugins .json .Json ;
4142import com .jme3 .plugins .json .JsonParser ;
@@ -338,14 +339,14 @@ private static void populateShortBuffer(ShortBuffer buffer, LittleEndien stream,
338339 int dataLength = componentSize * numComponents ;
339340 int stride = Math .max (dataLength , byteStride );
340341 int end = count * stride + byteOffset ;
341- stream . skipBytes ( byteOffset );
342+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
342343 while (index < end ) {
343344 for (int i = 0 ; i < numComponents ; i ++) {
344345 buffer .put (stream .readShort ());
345346 }
346347
347348 if (dataLength < stride ) {
348- stream . skipBytes ( stride - dataLength );
349+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
349350 }
350351 index += stride ;
351352 }
@@ -358,13 +359,13 @@ private static void populateIntBuffer(IntBuffer buffer, LittleEndien stream, int
358359 int dataLength = componentSize * numComponents ;
359360 int stride = Math .max (dataLength , byteStride );
360361 int end = count * stride + byteOffset ;
361- stream . skipBytes ( byteOffset );
362+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
362363 while (index < end ) {
363364 for (int i = 0 ; i < numComponents ; i ++) {
364365 buffer .put (stream .readInt ());
365366 }
366367 if (dataLength < stride ) {
367- stream . skipBytes ( stride - dataLength );
368+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
368369 }
369370 index += stride ;
370371 }
@@ -376,13 +377,13 @@ private static void populateFloatBuffer(FloatBuffer buffer, LittleEndien stream,
376377 int dataLength = componentSize * numComponents ;
377378 int stride = Math .max (dataLength , byteStride );
378379 int end = count * stride + byteOffset ;
379- stream . skipBytes ( byteOffset );
380+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
380381 while (index < end ) {
381382 for (int i = 0 ; i < numComponents ; i ++) {
382383 buffer .put (readAsFloat (stream , format ));
383384 }
384385 if (dataLength < stride ) {
385- stream . skipBytes ( stride - dataLength );
386+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
386387 }
387388 index += stride ;
388389 }
@@ -423,7 +424,7 @@ private static void populateByteArray(byte[] array, LittleEndien stream, int cou
423424 int dataLength = componentSize * numComponents ;
424425 int stride = Math .max (dataLength , byteStride );
425426 int end = count * stride + byteOffset ;
426- stream . skipBytes ( byteOffset );
427+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
427428
428429 if (dataLength == stride ) {
429430 read (stream , array , end - index );
@@ -438,7 +439,7 @@ private static void populateByteArray(byte[] array, LittleEndien stream, int cou
438439 System .arraycopy (buffer , 0 , array , arrayIndex , numComponents );
439440 arrayIndex += numComponents ;
440441 if (dataLength < stride ) {
441- stream . skipBytes ( stride - dataLength );
442+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
442443 }
443444 index += stride ;
444445 }
@@ -461,7 +462,7 @@ private static void populateShortArray(short[] array, LittleEndien stream, int c
461462 int dataLength = componentSize * numComponents ;
462463 int stride = Math .max (dataLength , byteStride );
463464 int end = count * stride + byteOffset ;
464- stream . skipBytes ( byteOffset );
465+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
465466 int arrayIndex = 0 ;
466467 while (index < end ) {
467468 for (int i = 0 ; i < numComponents ; i ++) {
@@ -473,7 +474,7 @@ private static void populateShortArray(short[] array, LittleEndien stream, int c
473474 arrayIndex ++;
474475 }
475476 if (dataLength < stride ) {
476- stream . skipBytes ( stride - dataLength );
477+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
477478 }
478479 index += stride ;
479480 }
@@ -563,15 +564,15 @@ private static void populateFloatArray(float[] array, LittleEndien stream, int c
563564 int dataLength = componentSize * numComponents ;
564565 int stride = Math .max (dataLength , byteStride );
565566 int end = count * stride + byteOffset ;
566- stream . skipBytes ( byteOffset );
567+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
567568 int arrayIndex = 0 ;
568569 while (index < end ) {
569570 for (int i = 0 ; i < numComponents ; i ++) {
570571 array [arrayIndex ] = readAsFloat (stream , format );
571572 arrayIndex ++;
572573 }
573574 if (dataLength < stride ) {
574- stream . skipBytes ( stride - dataLength );
575+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
575576 }
576577 index += stride ;
577578 }
@@ -583,7 +584,7 @@ private static void populateVector3fArray(Vector3f[] array, LittleEndien stream,
583584 int dataLength = componentSize * numComponents ;
584585 int stride = Math .max (dataLength , byteStride );
585586 int end = count * stride + byteOffset ;
586- stream . skipBytes ( byteOffset );
587+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
587588 int arrayIndex = 0 ;
588589 while (index < end ) {
589590 array [arrayIndex ] = new Vector3f (
@@ -594,7 +595,7 @@ private static void populateVector3fArray(Vector3f[] array, LittleEndien stream,
594595
595596 arrayIndex ++;
596597 if (dataLength < stride ) {
597- stream . skipBytes ( stride - dataLength );
598+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
598599 }
599600
600601 index += stride ;
@@ -607,7 +608,7 @@ private static void populateQuaternionArray(Quaternion[] array, LittleEndien str
607608 int dataLength = componentSize * numComponents ;
608609 int stride = Math .max (dataLength , byteStride );
609610 int end = count * stride + byteOffset ;
610- stream . skipBytes ( byteOffset );
611+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
611612 int arrayIndex = 0 ;
612613 while (index < end ) {
613614 array [arrayIndex ] = new Quaternion (
@@ -619,7 +620,7 @@ private static void populateQuaternionArray(Quaternion[] array, LittleEndien str
619620
620621 arrayIndex ++;
621622 if (dataLength < stride ) {
622- stream . skipBytes ( stride - dataLength );
623+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
623624 }
624625 index += stride ;
625626 }
@@ -631,7 +632,7 @@ private static void populateMatrix4fArray(Matrix4f[] array, LittleEndien stream,
631632 int dataLength = componentSize * numComponents ;
632633 int stride = Math .max (dataLength , byteStride );
633634 int end = count * stride + byteOffset ;
634- stream . skipBytes ( byteOffset );
635+ ByteUtils . skipFully (( InputStream ) stream , byteOffset );
635636 int arrayIndex = 0 ;
636637 while (index < end ) {
637638
@@ -657,7 +658,7 @@ private static void populateMatrix4fArray(Matrix4f[] array, LittleEndien stream,
657658
658659 arrayIndex ++;
659660 if (dataLength < stride ) {
660- stream . skipBytes ( stride - dataLength );
661+ ByteUtils . skipFully (( InputStream ) stream , stride - dataLength , false );
661662 }
662663
663664 index += stride ;
0 commit comments