public double[] levelZeroData(){
  List<Buffer> levelZeroBuffers=bufferMap.get(0);
  int length=0;
  for (  Buffer buffer : levelZeroBuffers) {
    if (!buffer.hasCapacity()) {
      length+=buffer.size;
    }
 else {
      length+=buffer.next;
    }
  }
  int pos=0;
  int currLen;
  final double[] out=new double[length];
  for (  Buffer buffer : levelZeroBuffers) {
    if (!buffer.hasCapacity()) {
      currLen=buffer.size;
    }
 else {
      currLen=buffer.next;
    }
    System.arraycopy(buffer.data,0,out,pos,currLen);
    pos+=currLen;
  }
  return out;
}

public double [ ] levelZeroData ( ) { List < Buffer > levelZeroBuffers = bufferMap . get ( 0 ) ; int length = 0 ; for ( Buffer buffer : levelZeroBuffers ) { if ( ! buffer . hasCapacity ( ) ) { length += buffer . size ; } else { length += buffer . next ; } } int pos = 0 ; int currLen ; final double [ ] out = new double [ length ] ; for ( Buffer buffer : levelZeroBuffers ) { if ( ! buffer . hasCapacity ( ) ) { currLen = buffer . size ; } else { currLen = buffer . next ; } System . arraycopy ( buffer . data , 0 , out , pos , currLen ) ; pos += currLen ; } return out ; }
returns a fresh copy of all data from level 0 buffers .
