@ SuppressWarnings ( "unchecked" ) protected Map < String , byte [ ] > documentToBytesMap ( Map < String , Object > doc ) { if ( doc == null || doc . size ( ) == 0 ) { return Collections . EMPTY_MAP ; } Map < String , byte [ ] > data = new HashMap <> ( ) ; doc . forEach ( ( k , v ) -> { byte [ ] value = SerializationUtils . toByteArrayFst ( v ) ; if ( value != null ) { data . put ( k , value ) ; } } ) ; return data ; }
Sereialize document to byte - array map .