public long getOffset() throws IOException { return rais.getOffset(); }
/** * Overrides <code>InputStream.mark()</code> to provide a working implementation of the method. The given readLimit * is simply ignored, the stream can be repositionned using {@link #reset()} with no limit on the number of bytes * read after <code>mark()</code> has been called. * * @param readLimit this parameter has no effect and is simply ignored */ @Override public synchronized void mark(int readLimit) { try { this.markOffset = getOffset(); } catch (IOException e) { LOGGER.info("Caught exception", e); } }
/** * Return the number of bytes that are available for reading, that is: {@link #getLength()} - {@link #getOffset()} - 1. * Since <code>InputStream.available()</code> returns an int and this method overrides it, a maximum of * <code>Integer.MAX_VALUE</code> can be returned, even if this stream has more bytes available. * * @return the number of bytes that are available for reading. * @throws IOException if something went wrong */ @Override public int available() throws IOException { return (int)(getLength() - getOffset() - 1); }
return 0; long offset = getOffset(); long length = getLength();
long centralDirectoryStart = rais.getOffset(); raos.seek(centralDirectoryStart);
entryInfo.centralHeaderOffset = rais.getOffset() - 4; // 4 for the header signature