/** * Create a {@link CompressionInputStream} that will read from the given * {@link InputStream} with the given {@link Decompressor}, and return a * stream for uncompressed data. * * @param in the stream to read compressed bytes from * @param decompressor decompressor to use * @return a stream to read uncompressed bytes from * @throws IOException */ @Override public CompressionInputStream createInputStream(InputStream in, Decompressor decompressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new DecompressorStream(in, decompressor, conf.getInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT)) : new BZip2CompressionInputStream( in, 0L, Long.MAX_VALUE, READ_MODE.BYBLOCK); }
if (this.startingPos == 0) { bufferedIn = readStreamHeader(); } else if (this.readMode == READ_MODE.BYBLOCK && this.startingPos <= HEADER_LEN + SUB_HEADER_LEN) { this.updatePos(false);
new BZip2CompressionInputStream(seekableIn, adjStart, end, readMode); in = new BZip2CompressionInputStream(seekableIn, start, end, readMode);
internalReset(); this.updatePos(true); this.posSM = POS_ADVERTISEMENT_STATE_MACHINE.HOLD;
new BZip2CompressionInputStream(seekableIn, adjStart, end, readMode); in = new BZip2CompressionInputStream(seekableIn, start, end, readMode);
new BZip2CompressionInputStream(seekableIn, adjStart, end, readMode); in = new BZip2CompressionInputStream(seekableIn, start, end, readMode);
internalReset(); this.updatePos(true); this.posSM = POS_ADVERTISEMENT_STATE_MACHINE.HOLD;
internalReset(); this.updatePos(true); this.posSM = POS_ADVERTISEMENT_STATE_MACHINE.HOLD;
internalReset(); this.updatePos(true); this.posSM = POS_ADVERTISEMENT_STATE_MACHINE.HOLD;
/** * Creates CompressionInputStream to be used to read off uncompressed data * in one of the two reading modes. i.e. Continuous or Blocked reading modes * * @param seekableIn The InputStream * @param start The start offset into the compressed stream * @param end The end offset into the compressed stream * @param readMode Controls whether progress is reported continuously or * only at block boundaries. * * @return CompressionInputStream for BZip2 aligned at block boundaries */ public SplitCompressionInputStream createInputStream(InputStream seekableIn, Decompressor decompressor, long start, long end, READ_MODE readMode) throws IOException { if (!(seekableIn instanceof Seekable)) { throw new IOException("seekableIn must be an instance of " + Seekable.class.getName()); } ((Seekable)seekableIn).seek(start); return new BZip2CompressionInputStream(seekableIn, start, end, readMode); }
public BZip2CompressionInputStream(InputStream in, long start, long end, READ_MODE readMode) throws IOException { super(in, start, end); needsReset = false; bufferedIn = new BufferedInputStream(super.in); this.startingPos = super.getPos(); this.readMode = readMode; if (this.startingPos == 0) { // We only strip header if it is start of file bufferedIn = readStreamHeader(); } input = new CBZip2InputStream(bufferedIn, readMode); if (this.isHeaderStripped) { input.updateReportedByteCount(HEADER_LEN); } if (this.isSubHeaderStripped) { input.updateReportedByteCount(SUB_HEADER_LEN); } this.updatePos(false); }
/** * Create a {@link CompressionInputStream} that will read from the given * {@link InputStream} with the given {@link Decompressor}, and return a * stream for uncompressed data. * * @param in the stream to read compressed bytes from * @param decompressor decompressor to use * @return a stream to read uncompressed bytes from * @throws IOException */ @Override public CompressionInputStream createInputStream(InputStream in, Decompressor decompressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new DecompressorStream(in, decompressor, conf.getInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT)) : new BZip2CompressionInputStream(in); }
public BZip2CompressionInputStream(InputStream in, long start, long end, READ_MODE readMode) throws IOException { super(in, start, end); needsReset = false; bufferedIn = new BufferedInputStream(super.in); this.startingPos = super.getPos(); this.readMode = readMode; if (this.startingPos == 0) { // We only strip header if it is start of file bufferedIn = readStreamHeader(); } input = new CBZip2InputStream(bufferedIn, readMode); if (this.isHeaderStripped) { input.updateReportedByteCount(HEADER_LEN); } if (this.isSubHeaderStripped) { input.updateReportedByteCount(SUB_HEADER_LEN); } this.updatePos(false); }
public BZip2CompressionInputStream(InputStream in, long start, long end, READ_MODE readMode) throws IOException { super(in, start, end); needsReset = false; bufferedIn = new BufferedInputStream(super.in); this.startingPos = super.getPos(); this.readMode = readMode; if (this.startingPos == 0) { // We only strip header if it is start of file bufferedIn = readStreamHeader(); } input = new CBZip2InputStream(bufferedIn, readMode); if (this.isHeaderStripped) { input.updateReportedByteCount(HEADER_LEN); } if (this.isSubHeaderStripped) { input.updateReportedByteCount(SUB_HEADER_LEN); } this.updatePos(false); }
public BZip2CompressionInputStream(InputStream in, long start, long end, READ_MODE readMode) throws IOException { super(in, start, end); needsReset = false; bufferedIn = new BufferedInputStream(super.in); this.startingPos = super.getPos(); this.readMode = readMode; if (this.startingPos == 0) { // We only strip header if it is start of file bufferedIn = readStreamHeader(); } input = new CBZip2InputStream(bufferedIn, readMode); if (this.isHeaderStripped) { input.updateReportedByteCount(HEADER_LEN); } if (this.isSubHeaderStripped) { input.updateReportedByteCount(SUB_HEADER_LEN); } this.updatePos(false); }
/** * Create a {@link CompressionInputStream} that will read from the given * {@link InputStream} with the given {@link Decompressor}, and return a * stream for uncompressed data. * * @param in the stream to read compressed bytes from * @param decompressor decompressor to use * @return a stream to read uncompressed bytes from * @throws IOException */ @Override public CompressionInputStream createInputStream(InputStream in, Decompressor decompressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new DecompressorStream(in, decompressor, conf.getInt("io.file.buffer.size", 4*1024)) : new BZip2CompressionInputStream(in); }
/** * Create a {@link CompressionInputStream} that will read from the given * {@link InputStream} with the given {@link Decompressor}, and return a * stream for uncompressed data. * * @param in the stream to read compressed bytes from * @param decompressor decompressor to use * @return a stream to read uncompressed bytes from * @throws IOException */ @Override public CompressionInputStream createInputStream(InputStream in, Decompressor decompressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new DecompressorStream(in, decompressor, conf.getInt("io.file.buffer.size", 4*1024)) : new BZip2CompressionInputStream(in); }
/** * Create a {@link CompressionInputStream} that will read from the given * {@link InputStream} with the given {@link Decompressor}, and return a * stream for uncompressed data. * * @param in the stream to read compressed bytes from * @param decompressor decompressor to use * @return a stream to read uncompressed bytes from * @throws IOException */ @Override public CompressionInputStream createInputStream(InputStream in, Decompressor decompressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new DecompressorStream(in, decompressor, conf.getInt("io.file.buffer.size", 4*1024)) : new BZip2CompressionInputStream(in); }
/** * Creates CompressionInputStream to be used to read off uncompressed data. * * @param in * The InputStream * @return Returns CompressionInputStream for BZip2 * @throws java.io.IOException * Throws IOException */ public CompressionInputStream createInputStream(InputStream in) throws IOException { return new BZip2CompressionInputStream(in); }
/** * Creates CompressionInputStream to be used to read off uncompressed data. * * @param in * The InputStream * @return Returns CompressionInputStream for BZip2 * @throws java.io.IOException * Throws IOException */ public CompressionInputStream createInputStream(InputStream in) throws IOException { return new BZip2CompressionInputStream(in); }