comparison src/luan/modules/IoLuan.java @ 1508:86c5e7000ecf

lucene.backup checksum
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 16 May 2020 17:56:02 -0600
parents e66e3d50b289
children 0ba144491a42
comparison
equal deleted inserted replaced
1507:c8f4867fd083 1508:86c5e7000ecf
203 throw e; 203 throw e;
204 } 204 }
205 } 205 }
206 206
207 public long checksum() throws IOException, LuanException { 207 public long checksum() throws IOException, LuanException {
208 long cs = 0; 208 return IoUtils.checksum( new BufferedInputStream(inputStream()) );
209 InputStream in = new BufferedInputStream(inputStream());
210 int c;
211 while( (c=in.read()) != -1 ) {
212 cs = 31 * cs + c;
213 }
214 in.close();
215 return cs;
216 } 209 }
217 210
218 public String charset() { 211 public String charset() {
219 return charset; 212 return charset;
220 } 213 }