
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.DeflaterInputStream;
import java.util.zip.DeflaterOutputStream;

public class HelloDeflaterAndInflaterStreams {
	private static final String FILENAME = "deflated.txt";
	public static void main(String...args) {
		System.out.println("Hello Deflater and Inflater Streams");
		
		try {
			DeflaterOutputStream dos = new DeflaterOutputStream(
				new FileOutputStream(
					new File(FILENAME)));
			
			for (int i = 0; i < 100; i++)  {
				dos.write("Hello World\n".getBytes());
			}
			dos.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		
		try {
			DeflaterInputStream dis = new DeflaterInputStream(
				new FileInputStream(
					new File(FILENAME)));
			
			for (int i = 0; i < 100; i++)  {
				System.out.print(dis.read());
			}
			dis.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}

@@ -1,25 +1,24 @@
-%0A
 import java.io.File;%0Aimp
@@ -278,17 +278,20 @@
 reams %7B%0A
-%09
+    
 private 
@@ -337,17 +337,21 @@
 d.txt%22;%0A
-%09
+%0A    
 public s
@@ -379,16 +379,17 @@
 g...
+ 
 args) %7B%0A
 %09%09Sy
@@ -384,18 +384,24 @@
 args) %7B%0A
-%09%09
+        
 System.o
@@ -451,30 +451,43 @@
 eams%22);%0A
-%09%09%0A%09%09try %7B%0A%09%09%09
+%0A        try %7B%0A            
 Deflater
@@ -501,24 +501,41 @@
 tream dos = 
+%0A                
 new Deflater
@@ -539,37 +539,32 @@
 terOutputStream(
-%0A%09%09%09%09
 new FileOutputSt
@@ -560,38 +560,32 @@
 ileOutputStream(
-%0A%09%09%09%09%09
 new File(FILENAM
@@ -582,39 +582,45 @@
 le(FILENAME)));%0A
-%09%09%09%0A%09%09%09
+%0A            
 for (int i = 0; 
@@ -632,24 +632,35 @@
 00; i++)
- 
  %7B%0A
-%09%09%09%09
+                
 dos.writ
@@ -690,24 +690,42 @@
 tes());%0A
-%09%09%09%7D%0A%09%09%09
+            %7D%0A            
 dos.clos
@@ -721,34 +721,40 @@
    dos.close();%0A
-%09%09
+        
 %7D catch (FileNot
@@ -765,35 +765,44 @@
 dException e) %7B%0A
-%09%09%09
+            
 e.printStackTrac
@@ -798,34 +798,40 @@
 ntStackTrace();%0A
-%09%09
+        
 %7D catch (IOExcep
@@ -832,35 +832,44 @@
 OException e) %7B%0A
-%09%09%09
+            
 e.printStackTrac
@@ -877,27 +877,45 @@
 ();%0A
-%09%09%7D%0A%0A%09%09%0A%09%09try %7B%0A%09%09%09
+        %7D%0A%0A        try %7B%0A            
 Defl
@@ -936,16 +936,33 @@
 m dis = 
+%0A                
 new Defl
@@ -977,21 +977,16 @@
 tStream(
-%0A%09%09%09%09
 new File
@@ -1001,14 +1001,8 @@
 eam(
-%0A%09%09%09%09%09
 new 
@@ -1023,15 +1023,21 @@
 ));%0A
-%09%09%09%0A%09%09%09
+%0A            
 for 
@@ -1065,16 +1065,27 @@
 i++)
- 
  %7B%0A
-%09%09%09%09
+                
 Syst
@@ -1114,16 +1114,34 @@
 ));%0A
-%09%09%09%7D%0A%09%09%09
+            %7D%0A            
 dis.
@@ -1145,26 +1145,32 @@
 is.close();%0A
-%09%09
+        
 %7D catch (Fil
@@ -1185,35 +1185,44 @@
 dException e) %7B%0A
-%09%09%09
+            
 e.printStackTrac
@@ -1226,18 +1226,24 @@
 race();%0A
-%09%09
+        
 %7D catch 
@@ -1264,11 +1264,20 @@
 ) %7B%0A
-%09%09%09
+            
 e.pr
@@ -1297,14 +1297,22 @@
 ();%0A
-%09%09%7D%0A%0A%09
+        %7D%0A    
 %7D%0A%7D%0A

Update HelloDeflaterAndInflaterStreams.java