com.github.junrar.volume.InputStreamVolume Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junrar Show documentation
Show all versions of junrar Show documentation
rar decompression library in plain java
package com.github.junrar.volume;
import com.github.junrar.Archive;
import com.github.junrar.io.SeekableReadOnlyByteChannel;
import com.github.junrar.io.SeekableReadOnlyInputStream;
import java.io.InputStream;
public class InputStreamVolume implements Volume {
private final Archive archive;
private final InputStream inputStream;
private final int position;
public InputStreamVolume(final Archive archive, final InputStream inputStream, final int position) {
this.archive = archive;
this.inputStream = inputStream;
this.position = position;
}
@Override
public SeekableReadOnlyByteChannel getChannel() {
return new SeekableReadOnlyInputStream(this.inputStream);
}
@Override
public long getLength() {
return Long.MAX_VALUE;
}
@Override
public Archive getArchive() {
return this.archive;
}
public int getPosition() {
return position;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy