io.sensesecure.hadoop.xz.XZSeekableInputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hadoop-xz Show documentation
Show all versions of hadoop-xz Show documentation
XZ (LZMA/LZMA2) Codec for Apache Hadoop
The newest version!
package io.sensesecure.hadoop.xz;
import java.io.IOException;
import java.io.InputStream;
import org.apache.hadoop.fs.Seekable;
import org.tukaani.xz.SeekableInputStream;
/**
*
* @author yongtang
*/
public class XZSeekableInputStream extends SeekableInputStream {
private final InputStream seekableIn;
private final long length;
XZSeekableInputStream(InputStream in, long len) {
seekableIn = in;
length = len;
}
@Override
public long length() throws IOException {
return length;
}
@Override
public long position() throws IOException {
return ((Seekable) seekableIn).getPos();
}
@Override
public void seek(long pos) throws IOException {
((Seekable) seekableIn).seek(pos);
}
@Override
public int read() throws IOException {
if (((Seekable) seekableIn).getPos()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy