public byte [ ] prepareEncrypt ( Field field , Map < String , String > context ) { context . put ( SDC_FIELD_TYPE , field . getType ( ) . name ( ) ) ; if ( field . getType ( ) == Field . Type . BYTE_ARRAY ) { return field . getValueAsByteArray ( ) ; } else { // Treat all other data as strings return field . getValueAsString ( ) . getBytes ( Charsets . UTF_8 ) ; } }
Does data type conversions in preparation for encryption .