@ Override public byte [ ] toBytes ( T instance ) throws IllegalArgumentException { try { return mapper . writeValueAsBytes ( instance ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( format ( "%s could not be converted to SMILE" , instance . getClass ( ) . getName ( ) ) , e ) ; } }
Converts the specified instance to smile encoded bytes .