public int getHeaderOffset() throws java.io.IOException { String str = readString(1024); int idx = str.indexOf("%PDF-"); if (idx < 0) { idx = str.indexOf("%FDF-"); if (idx < 0) throw new IOException(IOException.PdfHeaderNotFound, this); } return idx; }
public int getHeaderOffset() throws java.io.IOException { String str = readString(1024); int idx = str.indexOf("%PDF-"); if (idx < 0) { idx = str.indexOf("%FDF-"); if (idx < 0) throw new IOException(IOException.PdfHeaderNotFound, this); } return idx; }
public String checkPdfHeader() throws java.io.IOException { file.seek(0); String str = readString(1024); int idx = str.indexOf("%PDF-"); if (idx != 0) throw new IOException(IOException.PdfHeaderNotFound, this); return str.substring(idx + 1, idx + 8); }
public String checkPdfHeader() throws java.io.IOException { file.seek(0); String str = readString(1024); int idx = str.indexOf("%PDF-"); if (idx != 0) throw new IOException(IOException.PdfHeaderNotFound, this); return str.substring(idx + 1, idx + 8); }
public void checkFdfHeader() throws java.io.IOException { file.seek(0); String str = readString(1024); int idx = str.indexOf("%FDF-"); if (idx != 0) throw new IOException(IOException.FdfStartxrefNotFound, this); }
public void checkFdfHeader() throws java.io.IOException { file.seek(0); String str = readString(1024); int idx = str.indexOf("%FDF-"); if (idx != 0) throw new IOException(IOException.FdfStartxrefNotFound, this); }
public long getStartxref() throws java.io.IOException { int arrLength = 1024; long fileLength = file.length(); long pos = fileLength - arrLength; if (pos < 1) pos = 1; while (pos > 0) { file.seek(pos); String str = readString(arrLength); int idx = str.lastIndexOf("startxref"); if (idx >= 0) return pos + idx; pos = pos - arrLength + 9; // 9 = "startxref".length() } throw new IOException(IOException.PdfStartxrefNotFound, this); }
public long getStartxref() throws java.io.IOException { int arrLength = 1024; long fileLength = file.length(); long pos = fileLength - arrLength; if (pos < 1) pos = 1; while (pos > 0) { file.seek(pos); String str = readString(arrLength); int idx = str.lastIndexOf("startxref"); if (idx >= 0) return pos + idx; pos = pos - arrLength + 9; // 9 = "startxref".length() } throw new IOException(IOException.PdfStartxrefNotFound, this); }
} else { tokens.seek(start + streamLength); String line = tokens.readString(20); if (!line.startsWith(endstream2) && !line.startsWith(endstream3) && !line.startsWith(endstream4) && !line.startsWith(endstream1)) { } else if (line.startsWith(endobj)) { tokens.seek(pos - 16); String s = tokens.readString(16); int index = s.indexOf(endstream1); if (index >= 0)