public void writeTo ( OutputStream out ) throws TLVParserException { Util . notNull ( out , "Output stream" ) ; try { assertActualContentLengthIsInTLVLimits ( getContentLength ( ) ) ; out . write ( encodeHeader ( ) ) ; out . write ( getContent ( ) ) ; } catch ( IOException e ) { throw new TLVParserException ( "Writing TLV element (" + convertHeader ( ) + ") to output stream failed" , e ) ; } }
Writes the encoded TLV element to the specified output stream .