Package com.itextpdf.text.pdf
Class StringUtils
- java.lang.Object
-
- com.itextpdf.text.pdf.StringUtils
-
public class StringUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateStringUtils()
-
Method Summary
All Methods Static Methods Concrete Methods 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 abytearray according to the PDF conventions.static voidescapeString(byte[] bytes, ByteBuffer content)Escapes abytearray according to the PDF conventions.
-
-
-
Method Detail
-
escapeString
public static byte[] escapeString(byte[] bytes)
Escapes abytearray according to the PDF conventions.- Parameters:
bytes- thebytearray to escape- Returns:
- an escaped
bytearray
-
escapeString
public static void escapeString(byte[] bytes, ByteBuffer content)Escapes abytearray according to the PDF conventions.- Parameters:
bytes- thebytearray to escapecontent- 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
-
-