Package com.sun.pdfview.font
Class Type1Font.PSParser
- java.lang.Object
-
- com.sun.pdfview.font.Type1Font.PSParser
-
- Enclosing class:
- Type1Font
class Type1Font.PSParser extends java.lang.Object
PostScript reader (not a parser, as the name would seem to indicate).
-
-
Constructor Summary
Constructors Constructor Description PSParser(byte[] data, int start)
create a PostScript reader given some data and an initial offset into that data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
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.java.lang.String
readThing()
get the next postscript "word".void
setLoc(int loc)
set the current location within the input stream
-
-
-
Method Detail
-
readThing
public java.lang.String 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.
-
-