public void flush() throws java.io.IOException
        {
            super.flush();
            
            if( position > 0 )
            {
                if( encode )
                {
                    out.write(base64.encode3to4( buffer, position ) );
                    position = 0;
                }   // end if: encoding
                else
                {   
                    throw new java.io.IOException( "Base64 input not properly padded." );
                }   // end else: decoding
            }   // end if: buffer partially full
            
            out.flush();
        }   // end flush