public void writeTo ( @ Nonnull @ WillNotClose final OutputStream aOS , final boolean bClearBuffer ) throws IOException { ValueEnforcer . notNull ( aOS , "OutputStream" ) ; aOS . write ( m_aBuffer . array ( ) , m_aBuffer . arrayOffset ( ) , m_aBuffer . position ( ) ) ; if ( bClearBuffer ) m_aBuffer . clear ( ) ; }
Write everything to the passed output stream and optionally clear the contained buffer . This works only if the contained ByteBuffer has a backing array .