{
if( !Thread.holdsLock( fileSync )) throw new IllegalMonitorStateException();
final long floorStart = span.start & MAXMASK;
final long ceilStop = (span.stop + MAXCEILADD) & MAXMASK;
final Span extSpan = (floorStart == span.start) && (ceilStop == span.stop) ?
span : new Span( floorStart, ceilStop );
final Span[] fileSpans = new Span[ SUBNUM ];
final Span[] biasedSpans = new Span[ SUBNUM ];
long fileStart;
long fileStop;
if( tempFAsync == null ) {
// XXX THIS IS THE PLACE TO OPEN WAVEFORM CACHE FILE
tempFAsync = createTempFiles();
}
synchronized( tempFAsync ) {
for( int i = 0; i < SUBNUM; i++ ) {
fileStart = tempFAsync[ i ].getFrameNum();
fileStop = fileStart + (extSpan.getLength() >> decimHelps[ i ].shift);
tempFAsync[ i ].setFrameNum( fileStop );
fileSpans[ i ] = new Span( fileStart, fileStop );
biasedSpans[ i ] = extSpan;
}
}
return new DecimatedStake( extSpan, tempFAsync, fileSpans, biasedSpans, decimHelps );
}