public void toBytesSparse ( ByteBuffer buf ) { buf . putInt ( size ) ; buf . putInt ( - 1 * binCount ) ; // use negative binCount to indicate sparse storage for ( int i = 0 ; i < binCount ; ++ i ) { buf . putFloat ( positions [ i ] ) ; } for ( int i = 0 ; i < binCount ; ++ i ) { buf . putLong ( bins [ i ] ) ; } buf . putFloat ( min ) ; buf . putFloat ( max ) ; }
Writes the sparse representation of this ApproximateHistogram object to the given byte - buffer