Guest User

Untitled

a guest
Nov 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. private String decompress(String s){
  2. int place = 0;
  3. int spot = 1;
  4. int c = image.charAt(0);
  5. String complete = "";
  6. String compressedImage = compress(image);
  7.  
  8. System.out.print("Comprssd File Size : 49 bits : ");
  9. while(place<compressedImage.length()){
  10.  
  11. char nameRepeat = compressedImage.charAt(place);
  12. char totalRepeat = compressedImage.charAt(spot);
  13.  
  14. System.out.print(nameRepeat);
  15. System.out.print(totalRepeat);
  16.  
  17. if(nameRepeat==&#039;A&#039;) {
  18. for(int i=1;i<totalRepeat;i++){
  19. complete+="1";
  20. }
  21. }
  22. if(nameRepeat==&#039;B&#039;) {
  23. for(int i=1;i<totalRepeat;i++){
  24. complete+="0";
  25. }
  26. }
  27. place+=2;
  28. spot+=2;
  29.  
  30. }
  31. return complete;
  32. }
  33.  
  34. public static void main(String[] args) {
  35. GraphicCompression gc = new GraphicCompression();
  36. }
  37. }
Add Comment
Please, Sign In to add comment