ZipInputStream jstream=null;
Hashtable strmentries = null;
private void streamInit() {
- if (!stream) {
+ throw new Error("VamsasArchiveReader(Stream) Not implemented!");
+ /* if (!stream) {
log.debug("Skipping init for Jar Stream input.");
return;
}
if (jstream.available()==0)
log.warn("Can't read from JarInputStream (Locked stream!)");
ZipEntry entry=null;
+ long pos=0;
do {
- long pos = rfile.getFilePointer();
if ((entry=jstream.getNextEntry())!=null) {
if (strmentries.containsKey(entry.getName())) {
log.info("Only recording last of duplicate entries '"+entry.getName()+"'");
}
- strmentries.put(entry.getName(), new Long(pos));
+ strmentries.put(entry.getName(), new Long(pos++));
jstream.closeEntry();
}
} while (entry!=null);
catch (Exception e) {
log.warn("Exceptions during init!",e);
jstream=null;
- }
+ }*/
}
public VamsasArchiveReader(File vamsasfile) {
* @param vamsaslock
*/
public VamsasArchiveReader(Lock vamsaslock) {
- rfile = vamsaslock.rafile;
- stream = true;
- streamInit();
- if (jstream==null)
- throw new Error("Failed to open archive from Locked random access stream.");
+ // LATER: implement or remove
+ throw new Error("VamsasArchiveReading from locked IO stream not yet implemented.");
+ //rfile = vamsaslock.rafile;
+ //stream = true;
+ //streamInit();
+ //if (jstream==null)
+ // throw new Error("Failed to open archive from Locked random access stream.");
}
/**
return null;
}
try {
- jstream.reset();
+ jstream=null;
+ rfile.seek(0);
+ jstream = new ZipInputStream(new FileInputStream(rfile.getFD()));
ZipEntry entry = null;
long epos = entrypos.longValue();
do {