/** * Skips n bytes from the stream. If the end of * the stream has been reached before reading n bytes * then it returns. * <B>NB:</B> This method uses read() internally. * @param n long the number of characters to skip. * @return long the number of characters skipped. * @throws IOException if there is any error while * reading from the stream. */ public long skip(long n) throws IOException { /* TODO a more efficient implementation could be made */ long i = 0; for (; i < n && size < maxsize; i++) { this.read(); } return i; }
/** Get the document object representing the current document. */ public Document getDocument() { FixedSizeInputStream fsis = new FixedSizeInputStream(is, currentDocumentBlobLength); fsis.suppressClose(); Document rtr; try { rtr = documentClass.getConstructor(InputStream.class, Map.class, Tokeniser.class).newInstance(fsis, DocProperties, tokeniser); } catch (Exception e) { throw new RuntimeException(e); } return rtr; }
public Document getDocument() FixedSizeInputStream fsis = new FixedSizeInputStream(is, currentDocumentBlobLength); fsis.suppressClose(); Document rtr; try {
/** * Skips n bytes from the stream. If the end of * the stream has been reached before reading n bytes * then it returns. * <B>NB:</B> This method uses read() internally. * @param n long the number of characters to skip. * @return long the number of characters skipped. * @throws IOException if there is any error while * reading from the stream. */ public long skip(long n) throws IOException { /* TODO a more efficient implementation could be made */ long i = 0; for (; i < n && size < maxsize; i++) { this.read(); } return i; }