Guest User

Untitled

a guest
Dec 14th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public class Base64{
  2.  
  3. public static int getBase64ByteSize(String str){
  4.  
  5. long occurences = str.chars().filter(c -> c =='ä' ).count();
  6.  
  7. System.out.println(occurences);
  8. int n = str.length() + (int)occurences;
  9.  
  10. int z = 4 * (int) Math.ceil( (double) n/3);
  11.  
  12. return z;
  13. }
  14.  
  15.  
  16.  
  17. public static void main(String[] args){
  18.  
  19. System.out.println(getBase64ByteSize("Hätte"));
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment