public byte [ ] write ( Bean bean , boolean rootType ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( 1024 ) ; try { write ( bean , rootType , baos ) ; } catch ( IOException ex ) { throw new IllegalStateException ( ex ) ; } return baos . toByteArray ( ) ; }
Writes the bean to an array of bytes .