public int[] readIntArray(final int items,final JBBPByteOrder byteOrder) throws IOException {
  int pos=0;
  if (items < 0) {
    int[] buffer=new int[INITIAL_ARRAY_BUFFER_SIZE];
    while (hasAvailableData()) {
      final long next=readInt(byteOrder);
      if (buffer.length == pos) {
        final int[] newbuffer=new int[buffer.length << 1];
        System.arraycopy(buffer,0,newbuffer,0,buffer.length);
        buffer=newbuffer;
      }
      buffer[pos++]=(int)next;
    }
    if (buffer.length == pos) {
      return buffer;
    }
    final int[] result=new int[pos];
    System.arraycopy(buffer,0,result,0,pos);
    return result;
  }
 else {
    final int[] buffer=new int[items];
    for (int i=0; i < items; i++) {
      buffer[i]=readInt(byteOrder);
    }
    return buffer;
  }
}

public int [ ] readIntArray ( final int items , final JBBPByteOrder byteOrder ) throws IOException { int pos = 0 ; if ( items < 0 ) { int [ ] buffer = new int [ INITIAL_ARRAY_BUFFER_SIZE ] ; while ( hasAvailableData ( ) ) { final long next = readInt ( byteOrder ) ; if ( buffer . length == pos ) { final int [ ] newbuffer = new int [ buffer . length << 1 ] ; System . arraycopy ( buffer , 0 , newbuffer , 0 , buffer . length ) ; buffer = newbuffer ; } buffer [ pos ++ ] = ( int ) next ; } if ( buffer . length == pos ) { return buffer ; } final int [ ] result = new int [ pos ] ; System . arraycopy ( buffer , 0 , result , 0 , pos ) ; return result ; } else { final int [ ] buffer = new int [ items ] ; for ( int i = 0 ; i < items ; i ++ ) { buffer [ i ] = readInt ( byteOrder ) ; } return buffer ; } }
read number of integer items from the input stream .
