Package com.sun.pdfview.font
Class Type1Font.PSParser
java.lang.Object
com.sun.pdfview.font.Type1Font.PSParser
- Enclosing class:
Type1Font
PostScript reader (not a parser, as the name would seem to indicate).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPSParser
(byte[] data, int start) create a PostScript reader given some data and an initial offset into that data. -
Method Summary
Modifier and TypeMethodDescriptionint
getLoc()
get the current location within the input streambyte[]
getNEncodedBytes
(int n, int key, int skip) treat the next n bytes of the input stream as encoded information to be decrypted.float[]
readArray
(int count) read a set of numbers from the input.get the next postscript "word".void
setLoc
(int loc) set the current location within the input stream
-
Field Details
-
data
byte[] data -
loc
int loc
-
-
Constructor Details
-
PSParser
public PSParser(byte[] data, int start) create a PostScript reader given some data and an initial offset into that data.- Parameters:
data
- the bytes of the postscript informationstart
- an initial offset into the data
-
-
Method Details
-
readThing
get the next postscript "word". This is basically the next non-whitespace block between two whitespace delimiters. This means that something like " [2 4 53]" will produce three items, while " [2 4 56 ]" will produce four. -
readArray
public float[] readArray(int count) read a set of numbers from the input. This method doesn't pay any attention to "[" or "]" delimiters, and reads any non-numeric items as the number 0.- Parameters:
count
- the number of items to read- Returns:
- an array of count floats
-
getLoc
public int getLoc()get the current location within the input stream -
setLoc
public void setLoc(int loc) set the current location within the input stream -
getNEncodedBytes
public byte[] getNEncodedBytes(int n, int key, int skip) treat the next n bytes of the input stream as encoded information to be decrypted.- Parameters:
n
- the number of bytes to decryptkey
- the decryption keyskip
- the number of bytes to skip at the beginning of the decryption- Returns:
- an array of decrypted bytes. The length of the array will be n-skip.
-