/** 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;
}
CheckSum one file, given an open BufferedReader.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.