java.lang.Object
org.sejda.sambox.input.SourceReader
org.sejda.sambox.input.ContentStreamParser
- All Implemented Interfaces:
Closeable,AutoCloseable
Component responsible for parsing a content stream to extract operands and such.
-
Field Summary
FieldsFields inherited from class org.sejda.sambox.input.SourceReader
OBJ -
Constructor Summary
ConstructorsConstructorDescriptionContentStreamParser(org.sejda.io.SeekableSource source) ContentStreamParser(PDContentStream stream) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes theSeekableSourcethis reader was created from.private booleanprivate booleanisEndOfImageFrom(long position) private byte[]Reads data until it finds an "EI" operator followed by a whitespace.private voidnextInlineImage(Operator operator) private Objecttokens()Methods inherited from class org.sejda.sambox.input.SourceReader
isNextToken, length, offset, position, position, readGenerationNumber, readHexString, readInt, readIntegerNumber, readLine, readLiteralString, readLong, readName, readNumber, readObjectNumber, readToken, skipExpected, skipExpected, skipExpectedIndirectObjectDefinition, skipIndirectObjectDefinition, skipSpaces, skipTokenIfValue, source, unreadIfValid, unreadSpaces, unreadUntilSpaces
-
Field Details
-
cosParser
-
tokens
-
-
Constructor Details
-
ContentStreamParser
- Throws:
IOException
-
ContentStreamParser
public ContentStreamParser(org.sejda.io.SeekableSource source)
-
-
Method Details
-
tokens
- Returns:
- a list of tokens retrieved parsing the source this parser was created from.
- Throws:
IOException
-
nextParsedToken
- Returns:
- the next token parsed from the content stream
- Throws:
IOException
-
nextOperator
- Throws:
IOException
-
nextInlineImage
- Throws:
IOException
-
nextImageData
Reads data until it finds an "EI" operator followed by a whitespace.- Returns:
- the image data
- Throws:
IOException
-
isEndOfImageFrom
- Throws:
IOException
-
isEndOfImage
- Throws:
IOException
-
close
Description copied from class:SourceReaderCloses theSeekableSourcethis reader was created from.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSourceReader- Throws:
IOException
-