if (nextChar == '<') return parseCOSHexString(); braces = checkForEndOfString(braces); if( braces != 0 ) case ')': braces = checkForEndOfString(braces); if( braces != 0 ) while( isEOL(c) && c != -1)
COSBase value = parseDirObject(); skipSpaces(); if (!(value instanceof COSNumber) || !isDigit()) COSBase generationNumber = parseDirObject(); skipSpaces(); readExpectedChar('R'); if (!(value instanceof COSInteger)) ((COSInteger) generationNumber).intValue()); return getObjectFromPool(key);
skipSpaces(); while( !isWhitespace(c) && !isClosing(c) && c != -1 && buffer.length() < length && c != '[' && c != '<' &&
readExpectedChar('['); COSArray po = new COSArray(); COSBase pbo; skipSpaces(); int i; while( ((i = seqSource.peek()) > 0) && ((char)i != ']') ) pbo = parseDirObject(); if( pbo instanceof COSObject ) pbo = getObjectFromPool(key); String isThisTheEnd = readString(); seqSource.unread(isThisTheEnd.getBytes(ISO_8859_1)); if(ENDOBJ_STRING.equals(isThisTheEnd) || ENDSTREAM_STRING.equals(isThisTheEnd)) skipSpaces(); skipSpaces(); return po;
readExpectedChar('/'); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); int c = seqSource.read(); if (isHexDigit((char)ch1) && isHexDigit((char)ch2)) else if (isEndOfName(ch)) if (isValidUTF8(bytes))
/** * This will read the next string from the stream. * * @return The string that was read from the stream, never null. * * @throws IOException If there is an error reading from the stream. */ protected String readString() throws IOException { skipSpaces(); StringBuilder buffer = new StringBuilder(); int c = seqSource.read(); while( !isEndOfName((char)c) && c != -1 ) { buffer.append( (char)c ); c = seqSource.read(); } if (c != -1) { seqSource.unread(c); } return buffer.toString(); }
/** * This will skip all spaces and comments that are present. * * @throws IOException If there is an error reading from the stream. */ protected void skipSpaces() throws IOException { int c = seqSource.read(); // 37 is the % character, a comment while( isWhitespace(c) || c == 37) { if ( c == 37 ) { // skip past the comment section c = seqSource.read(); while(!isEOL(c) && c != -1) { c = seqSource.read(); } } else { c = seqSource.read(); } } if (c != -1) { seqSource.unread(c); } }
private static boolean isHexDigit(char ch) { return isDigit(ch) || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'); }
/** * This will tell if the next byte to be read is an end of line byte. * * @return true if the next byte is 0x0A or 0x0D. * * @throws IOException If there is an error reading from the stream. */ protected boolean isEOL() throws IOException { return isEOL(seqSource.peek()); }
/** * This will tell if the next byte is a space or not. * * @return true if the next byte in the stream is a space character. * * @throws IOException If there is an error reading from the stream. */ protected boolean isSpace() throws IOException { return isSpace(seqSource.peek()); }
/** * This will tell if the next character is a closing brace( close of PDF array ). * * @return true if the next byte is ']', false otherwise. * * @throws IOException If an IO error occurs. */ protected boolean isClosing() throws IOException { return isClosing(seqSource.peek()); }
if ( isHexDigit((char)c) )
readExpectedChar('['); COSArray po = new COSArray(); COSBase pbo; skipSpaces(); int i; while( ((i = seqSource.peek()) > 0) && ((char)i != ']') ) pbo = parseDirObject(); if( pbo instanceof COSObject ) pbo = getObjectFromPool(key); String isThisTheEnd = readString(); seqSource.unread(isThisTheEnd.getBytes(ISO_8859_1)); if(ENDOBJ_STRING.equals(isThisTheEnd) || ENDSTREAM_STRING.equals(isThisTheEnd)) skipSpaces(); skipSpaces(); return po;
readExpectedChar('/'); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); int c = seqSource.read(); if (isHexDigit((char)ch1) && isHexDigit((char)ch2)) else if (isEndOfName(ch)) if (isValidUTF8(bytes))
skipSpaces(); while( !isWhitespace(c) && !isClosing(c) && c != -1 && buffer.length() < length && c != '[' && c != '<' &&
/** * This will read the next string from the stream. * * @return The string that was read from the stream, never null. * * @throws IOException If there is an error reading from the stream. */ protected String readString() throws IOException { skipSpaces(); StringBuilder buffer = new StringBuilder(); int c = seqSource.read(); while( !isEndOfName((char)c) && c != -1 ) { buffer.append( (char)c ); c = seqSource.read(); } if (c != -1) { seqSource.unread(c); } return buffer.toString(); }
/** * This will skip all spaces and comments that are present. * * @throws IOException If there is an error reading from the stream. */ protected void skipSpaces() throws IOException { int c = seqSource.read(); // 37 is the % character, a comment while( isWhitespace(c) || c == 37) { if ( c == 37 ) { // skip past the comment section c = seqSource.read(); while(!isEOL(c) && c != -1) { c = seqSource.read(); } } else { c = seqSource.read(); } } if (c != -1) { seqSource.unread(c); } }