Class CosString

  • public class CosString
    extends CosScalar
    Represents a COS string as defined in section 3.2.3 of the PDF Reference Manual version 1.4.
    • Method Detail

      • getType

        public int getType()
        return the type of this CosObject
        Specified by:
        getType in class CosObject
        one of the t_Mumble static final int values defined above
      • byteArrayValue

        public byte[] byteArrayValue()
                              throws PDFSecurityException
        Obtains the string data. The first time the method is called, the string data is decrypted, if necessary, and the desired portion of the original data buffer is extracted.
        Byte array containing the string data.
      • textValue

        public String textValue()
                         throws PDFSecurityException
        Creates an instance of a String object "wrapping" the specified CosString. This method is called by the Factory class. A Class implementing the Constructible interface must implement this method.
        textValue in class CosObject
        Newly created String object or null if data is null.
      • setWriteHex

        public void setWriteHex​(boolean b)
        If true is passed here then this string is written in hex format.
      • getWriteHex

        public boolean getWriteHex()
        Returns true if this string is written in hex format.
      • isOddBall

        public boolean isOddBall()
        Returns true if this is hex string and ended on odd nibble.
      • setToEncrypt

        public void setToEncrypt​(boolean encrypted)
        Sets true if string is to be encrypted.
      • getToEncrypt

        public boolean getToEncrypt()
        Returns true if string is to be encrypted.
      • setIsEncrypted

        public void setIsEncrypted​(boolean encrypted)
        Sets the flag which tells whether this string is already encrypted or not.
      • getIsEncrypted

        public boolean getIsEncrypted()
        Tells whether this string is already encrypted or not.
      • equals

        public boolean equals​(ASString string)
      • equals

        public boolean equals​(CosString string)
      • equals

        public boolean equals​(CosObject value)
        This method returns true if both CosStrings have same byte array inside. Returns false if passed CosObject is not an instance of CosString or not on same document.
        Specified by:
        equals in class CosObject
        value -
      • equals

        public boolean equals​(byte[] b)