/** * Check whether line starts with object declaration. * @param lineTokenizer tokenizer, built by single line. * @return object number and generation if check is successful, otherwise - null. */ public static int[] checkObjectStart(PdfTokenizer lineTokenizer) { try { lineTokenizer.seek(0); if (!lineTokenizer.nextToken() || lineTokenizer.getTokenType() != TokenType.Number) return null; int num = lineTokenizer.getIntValue(); if (!lineTokenizer.nextToken() || lineTokenizer.getTokenType() != TokenType.Number) return null; int gen = lineTokenizer.getIntValue(); if (!lineTokenizer.nextToken()) return null; if (!Arrays.equals(Obj, lineTokenizer.getByteContent())) return null; return new int[]{num, gen}; } catch (Exception ioe) { // empty on purpose } return null; }
/** * Check whether line starts with object declaration. * @param lineTokenizer tokenizer, built by single line. * @return object number and generation if check is successful, otherwise - null. */ public static int[] checkObjectStart(PdfTokenizer lineTokenizer) { try { lineTokenizer.seek(0); if (!lineTokenizer.nextToken() || lineTokenizer.getTokenType() != TokenType.Number) return null; int num = lineTokenizer.getIntValue(); if (!lineTokenizer.nextToken() || lineTokenizer.getTokenType() != TokenType.Number) return null; int gen = lineTokenizer.getIntValue(); if (!lineTokenizer.nextToken()) return null; if (!Arrays.equals(Obj, lineTokenizer.getByteContent())) return null; return new int[]{num, gen}; } catch (Exception ioe) { // empty on purpose } return null; }
tokens.throwError(PdfException.ObjectNumberOfTheFirstObjectInThisXrefSubsectionNotFound); int start = tokens.getIntValue(); tokens.nextValidToken(); if (tokens.getTokenType() != PdfTokenizer.TokenType.Number) { tokens.throwError(PdfException.NumberOfEntriesInThisXrefSubsectionNotFound); int end = tokens.getIntValue() + start; for (int num = start; num < end; num++) { tokens.nextValidToken(); long pos = tokens.getLongValue(); tokens.nextValidToken(); int gen = tokens.getIntValue(); tokens.nextValidToken(); if (pos == 0L && gen == 65535 && num == 1 && start != 0) {
break; objNumber[k] = tokens.getIntValue(); ok = tokens.nextToken(); if (!ok) break; address[k] = tokens.getIntValue() + first;