1384N/A * The contents of this file are subject to the terms of the 1384N/A * Common Development and Distribution License (the "License"). 1384N/A * You may not use this file except in compliance with the License. 1384N/A * language governing permissions and limitations under the License. 1384N/A * When distributing Covered Code, include this CDDL HEADER in each 1384N/A * If applicable, add the following below this CDDL HEADER, with the 1384N/A * fields enclosed by brackets "[]" replaced with your own identifying 1384N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1384N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 1384N/A * Portions Copyright 2012 Jens Elkner. 1384N/A * A {@link FilterInputStream} for Opengrok crossfiles. 1384N/A * It uses a {@link BufferedInputStream} or {@link GZIPInputStream} as 1385N/A * underlying stream to provide the required functionality. So there is usually 1385N/A * no need to wrap it into another BufferedInputStream etc. . 1384N/A * Create a new InputStream from the given crossfile. The header gets read 1384N/A * automatically and thus internal cursor points to the start of the data 1384N/A * section of the crossfile, when this method returns. 1384N/A * @param file file to read. 1384N/A * @param uncompress if {@code true} crossfile data gets uncompressed on 1384N/A * the fly if they are compressed. 1384N/A * @throws IOException on read error or if the given file is not a crossfile 1384N/A * Get the header of the crossfile beeing read. 1384N/A * @return the crossfile header 1384N/A * Convinience method to check, whether the wrapped crossfile contains 1384N/A * @return {@code true} if data section is compressed. 1384N/A * @see XrefHeader#isCompressed() 1384N/A * Convinience method to get the Genre of data provided by this stream. 1384N/A * @return the data's genre. 1384N/A * @see XrefHeader#getGenre() 1384N/A * Get the file from which this stream has been created. 1384N/A * @return the origin of this stream 1384N/A * Dump all data not yet read to the given output stream. 1384N/A * @param out where to dump remaining data. 1384N/A * Dump all data not yet read to the given writer. The constructor for this 1384N/A * instance should have been called with on-the-fly uncompression enabled. 1384N/A * If not and the data of the stream are compressed, it is tried to switch 1384N/A * over to on-the-fly uncompression, but obviously this will fail with an 1384N/A * IOException, if any data have been read from this stream already. 1384N/A * @param out where to write data. 1384N/A * @throws IOException on read error 1384N/A * @see XrefInputStream#XrefInputStream(File, boolean) 1384N/A +
file +
" (wasn't specified in constructor)");
1384N/A char[]
buf =
new char[
4096];
// underlying buffers are suffient 1384N/A * Convinience method to dump a crossfile to the given writer.. 1384N/A * @param file crossfile to dump. 1384N/A * @param out dump destination. 1384N/A * @param script if {@code true} the javascript snippet 1384N/A * {@code O.lines=$num; O.createLinenums();} gets emitted to the writer 1384N/A * @return {@code true} on success. 1384N/A * Dump an opengrok cross file. 1384N/A * @param args opengrok crossfile name