@@ -90,14 +90,14 @@ public static void calculateBitSize(String filename) {
9090 filei = new File (filename );
9191
9292 try {
93- FileInputStream file_inputut = new FileInputStream (filei );
94- DataInputStream data_in = new DataInputStream (file_inputut );
93+ FileInputStream fileInput = new FileInputStream (filei );
94+ DataInputStream dataIn = new DataInputStream (fileInput );
9595
9696 Byte c ;
9797 int ch ;
9898 while (true ) {
9999 try {
100- c = data_in .readByte ();
100+ c = dataIn .readByte ();
101101 ch = CommonUtil .byteToUnsignedInt (c );
102102 String wc = w + (char ) ch ;
103103 if (dictionary .containsKey (wc ))
@@ -114,8 +114,8 @@ public static void calculateBitSize(String filename) {
114114 break ;
115115 }
116116 }
117- file_inputut .close ();
118- data_in .close ();
117+ fileInput .close ();
118+ dataIn .close ();
119119 } catch (IOException e ) {
120120 System .out .println ("IO exception = " + e );
121121 }
@@ -160,17 +160,17 @@ public static void compressFile(String filename) {
160160 fileo = new File (fileos );
161161
162162 try {
163- FileInputStream file_inputut = new FileInputStream (filei );
164- DataInputStream data_in = new DataInputStream (file_inputut );
165- FileOutputStream file_output = new FileOutputStream (fileo );
166- DataOutputStream data_out = new DataOutputStream (file_output );
163+ FileInputStream fileInput = new FileInputStream (filei );
164+ DataInputStream dataIn = new DataInputStream (fileInput );
165+ FileOutputStream fileOutput = new FileOutputStream (fileo );
166+ DataOutputStream dataOut = new DataOutputStream (fileOutput );
167167
168- data_out .writeInt (bitSize );
168+ dataOut .writeInt (bitSize );
169169 Byte c ;
170170 int ch ;
171171 while (true ) {
172172 try {
173- c = data_in .readByte ();
173+ c = dataIn .readByte ();
174174 ch = CommonUtil .byteToUnsignedInt (c );
175175
176176 String wc = w + (char ) ch ;
@@ -179,7 +179,7 @@ public static void compressFile(String filename) {
179179 else {
180180 bitBuffer += intToBinaryString (dictionary .get (w ));
181181 while (bitBuffer .length () >= 8 ) {
182- data_out .write (stringToByte (bitBuffer .substring (0 , 8 )));
182+ dataOut .write (stringToByte (bitBuffer .substring (0 , 8 )));
183183 bitBuffer = bitBuffer .substring (8 , bitBuffer .length ());
184184 }
185185
@@ -198,17 +198,17 @@ public static void compressFile(String filename) {
198198 if (!w .equals ("" )) {
199199 bitBuffer += intToBinaryString (dictionary .get (w ));
200200 while (bitBuffer .length () >= 8 ) {
201- data_out .write (stringToByte (bitBuffer .substring (0 , 8 )));
201+ dataOut .write (stringToByte (bitBuffer .substring (0 , 8 )));
202202 bitBuffer = bitBuffer .substring (8 , bitBuffer .length ());
203203 }
204204 if (bitBuffer .length () >= 1 ) {
205- data_out .write (stringToByte (bitBuffer ));
205+ dataOut .write (stringToByte (bitBuffer ));
206206 }
207207 }
208- data_in .close ();
209- data_out .close ();
210- file_inputut .close ();
211- file_output .close ();
208+ dataIn .close ();
209+ dataOut .close ();
210+ fileInput .close ();
211+ fileOutput .close ();
212212 } catch (IOException e ) {
213213 System .out .println ("IO exception = " + e );
214214 }
0 commit comments