Guest User

Untitled

a guest
Nov 12th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public static void bitStringToText (String binText){
  2. String bs = binText;
  3. int from =0;
  4. int to = 1;
  5.  
  6. while(bs != null){
  7. String temp = bs.substring(from, to);
  8. if (main.newMapDecoding.containsKey(temp)){
  9. main.decodedTxt += main.newMapDecoding.get(temp);
  10. from =to;
  11. to = from +1;
  12. } else {
  13. to = to + 1;
  14. }
  15. }
  16. }
  17.  
  18. public static void bitStringToText (String binText){
  19.  
  20. //no need to do this if you are not modifying the contents of binText
  21. //String bs = binText;
  22.  
  23. int from =0;
  24. int to = 1;
  25. int size = binText.length();
  26. String temp = "";
  27.  
  28. while(to <= size ){
  29. temp = binText.substring(from, to);
  30. if (main.newMapDecoding.containsKey(temp)){
  31. main.decodedTxt += main.newMapDecoding.get(temp);
  32. from =to;
  33. to = from +1;
  34. } else {
  35. to = to + 1;
  36. }
  37. }
  38. }
Add Comment
Please, Sign In to add comment