Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String decompress(String s){
- int place = 0;
- int spot = 1;
- int c = image.charAt(0);
- String complete = "";
- String compressedImage = compress(image);
- System.out.print("Comprssd File Size : 49 bits : ");
- while(place<compressedImage.length()){
- char nameRepeat = compressedImage.charAt(place);
- char totalRepeat = compressedImage.charAt(spot);
- System.out.print(nameRepeat);
- System.out.print(totalRepeat);
- if(nameRepeat=='A') {
- for(int i=1;i<totalRepeat;i++){
- complete+="1";
- }
- }
- if(nameRepeat=='B') {
- for(int i=1;i<totalRepeat;i++){
- complete+="0";
- }
- }
- place+=2;
- spot+=2;
- }
- return complete;
- }
- public static void main(String[] args) {
- GraphicCompression gc = new GraphicCompression();
- }
- }
Add Comment
Please, Sign In to add comment