954955956957958959960961962963964
FileSystem srcFs = getFS(srcPat); for (Path src : FileUtil.stat2Paths(srcFs.globStatus(srcPat), srcPat)) { Assert.isTrue(srcFs.isFile(src), "Source must be a file"); i = srcFs.open(src); switch (i.readShort()) { case 0x1f8b: // RFC 1952 i.seek(0); in = new GZIPInputStream(i); break; case 0x5345: // 'S' 'E'
125126127128129130131132133134135
@Override protected InputStream getInputStream(PathData item) throws IOException { FSDataInputStream i = (FSDataInputStream)super.getInputStream(item); // Check type of stream first switch(i.readShort()) { case 0x1f8b: { // RFC 1952 // Must be gzip i.seek(0); return new GZIPInputStream(i); }
108109110111112113114115116117118
6768697071727374757677
fileno = new short[blocks]; for (int i = 0; i < blocks; i++) { docnos[i] = in.readInt(); offsets[i] = in.readInt(); fileno[i] = in.readShort(); if (i > 0 && i % 100000 == 0) LOG.info(i + " blocks read"); }
filenos = new short[blocks]; for (int i = 0; i < blocks; i++) { docnos[i] = in.readInt(); offsets[i] = in.readInt(); filenos[i] = in.readShort(); } in.close(); }
6364656667686970717273
114115116117118119120121122123124
CompressionCodec codec = cf.getCodec(item.path); if (codec != null) { return codec.createInputStream(i); } switch(i.readShort()) { case 0x1f8b: { // RFC 1952 i.seek(0); return new GZIPInputStream(i); } case 0x5345: { // 'S' 'E'
117118119120121122123124125126127
122123124125126127128129130131132