comparison src/goodjava/lucene/logging/LogFile.java @ 1490:9a2a2181a58f

FixedLengthInputStream
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 02 May 2020 20:42:28 -0600
parents 2469aa31f31b
children 86c5e7000ecf
comparison
equal deleted inserted replaced
1489:fe237d72b234 1490:9a2a2181a58f
8 import java.io.FileInputStream; 8 import java.io.FileInputStream;
9 import java.io.FileOutputStream; 9 import java.io.FileOutputStream;
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.LimitedInputStream; 13 import goodjava.io.FixedLengthInputStream;
14 import goodjava.io.BufferedInputStream; 14 import goodjava.io.BufferedInputStream;
15 15
16 16
17 public class LogFile { 17 public class LogFile {
18 private static final Logger logger = LoggerFactory.getLogger(LogFile.class); 18 private static final Logger logger = LoggerFactory.getLogger(LogFile.class);
52 return new LogOutputStream(this,raf,out); 52 return new LogOutputStream(this,raf,out);
53 } 53 }
54 54
55 public LogInputStream input() throws IOException { 55 public LogInputStream input() throws IOException {
56 InputStream in = new FileInputStream(file); 56 InputStream in = new FileInputStream(file);
57 in = new LimitedInputStream(in,end); 57 in = new FixedLengthInputStream(in,end);
58 in = new BufferedInputStream(in); 58 in = new BufferedInputStream(in);
59 LogInputStream lis = newLogInputStream(in); 59 LogInputStream lis = newLogInputStream(in);
60 lis.readLong(); // skip end 60 lis.readLong(); // skip end
61 return lis; 61 return lis;
62 } 62 }