comparison src/goodjava/lucene/logging/LogFile.java @ 1508:86c5e7000ecf

lucene.backup checksum
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 16 May 2020 17:56:02 -0600
parents 9a2a2181a58f
children 117ce8645b7f
comparison
equal deleted inserted replaced
1507:c8f4867fd083 1508:86c5e7000ecf
10 import java.io.IOException; 10 import java.io.IOException;
11 import goodjava.logging.Logger; 11 import goodjava.logging.Logger;
12 import goodjava.logging.LoggerFactory; 12 import goodjava.logging.LoggerFactory;
13 import goodjava.io.FixedLengthInputStream; 13 import goodjava.io.FixedLengthInputStream;
14 import goodjava.io.BufferedInputStream; 14 import goodjava.io.BufferedInputStream;
15 import goodjava.io.IoUtils;
15 16
16 17
17 public class LogFile { 18 public class LogFile {
18 private static final Logger logger = LoggerFactory.getLogger(LogFile.class); 19 private static final Logger logger = LoggerFactory.getLogger(LogFile.class);
19 public final File file; 20 public final File file;
63 64
64 protected LogInputStream newLogInputStream(InputStream in) { 65 protected LogInputStream newLogInputStream(InputStream in) {
65 return new LogInputStream(in); 66 return new LogInputStream(in);
66 } 67 }
67 68
69 public long checksum() throws IOException {
70 return IoUtils.checksum(input());
71 }
72
68 static final int TYPE_NULL = 0; 73 static final int TYPE_NULL = 0;
69 static final int TYPE_STRING = 1; 74 static final int TYPE_STRING = 1;
70 static final int TYPE_INT = 2; 75 static final int TYPE_INT = 2;
71 static final int TYPE_LONG = 3; 76 static final int TYPE_LONG = 3;
72 static final int TYPE_FLOAT = 4; 77 static final int TYPE_FLOAT = 4;