Created
April 17, 2019 23:48
-
-
Save luisenriquecorona/dc4b178dd4edcd20550947819d55629d to your computer and use it in GitHub Desktop.
CheckSum one file, given an open BufferedReader.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** CheckSum one file, given an open BufferedReader. */ | |
public int process(BufferedReader is) { | |
int sum = 0; | |
try { | |
String inputLine; | |
while ((inputLine = is.readLine( )) != null) { | |
int i; | |
for (i=0; i<inputLine.length( ); i++) { | |
sum += inputLine.charAt(i); | |
} | |
} | |
is.close( ); | |
} catch (IOException e) { | |
System.out.println("IOException: " + e); | |
} f | |
return sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment