private void tailRecord ( byte [ ] b , int off , int len ) throws IOException { if ( this . position >= this . buffer . length ) { this . ensureDiskStream ( ) . write ( b , off , len ) ; this . position += len ; } else { assert this . buffer != null : "Buffer is null" ; int toCopy = ( int ) Math . min ( this . buffer . length - this . position , len ) ; assert b != null : "Passed buffer is null" ; System . arraycopy ( b , off , this . buffer , ( int ) this . position , toCopy ) ; this . position += toCopy ; // TODO verify these are +1 -1 right if ( toCopy < len ) { tailRecord ( b , off + toCopy , len - toCopy ) ; } } }
Record without digesting .