public void align ( ) throws IOException { if ( capacity < BITS_IN_BYTE ) { ostream . write ( buffer << capacity ) ; capacity = BITS_IN_BYTE ; buffer = 0 ; len ++ ; } }
If there are some unwritten bits pad them if necessary and write them out .