Class StringUtils

java.lang.Object
com.itextpdf.text.pdf.StringUtils

public class StringUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final byte[]
     
    private static final byte[]
     
    private static final byte[]
     
    private static final byte[]
     
    private static final byte[]
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    convertCharsToBytes(char[] chars)
    Converts an array of unsigned 16bit numbers to an array of bytes.
    static byte[]
    escapeString(byte[] bytes)
    Escapes a byte array according to the PDF conventions.
    static void
    escapeString(byte[] bytes, ByteBuffer content)
    Escapes a byte array according to the PDF conventions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • r

      private static final byte[] r
    • n

      private static final byte[] n
    • t

      private static final byte[] t
    • b

      private static final byte[] b
    • f

      private static final byte[] f
  • Constructor Details

    • StringUtils

      private StringUtils()
  • Method Details

    • escapeString

      public static byte[] escapeString(byte[] bytes)
      Escapes a byte array according to the PDF conventions.
      Parameters:
      bytes - the byte array to escape
      Returns:
      an escaped byte array
    • escapeString

      public static void escapeString(byte[] bytes, ByteBuffer content)
      Escapes a byte array according to the PDF conventions.
      Parameters:
      bytes - the byte array to escape
      content - the content
    • convertCharsToBytes

      public static byte[] convertCharsToBytes(char[] chars)
      Converts an array of unsigned 16bit numbers to an array of bytes. The input values are presented as chars for convenience.
      Parameters:
      chars - the array of 16bit numbers that should be converted
      Returns:
      the resulting byte array, twice as large as the input