public void setAvatar ( byte [ ] bytes , String mimeType ) { // If bytes is null, remove the avatar if ( bytes == null ) { removeAvatar ( ) ; return ; } // Otherwise, add to mappings. String encodedImage = Base64 . encodeToString ( bytes ) ; setAvatar ( encodedImage , mimeType ) ; }
Specify the bytes for the avatar to use as well as the mime type .