Package com.itextpdf.text.pdf
Class StringUtils
java.lang.Object
com.itextpdf.text.pdf.StringUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
convertCharsToBytes
(char[] chars) Converts an array of unsigned 16bit numbers to an array of bytes.static byte[]
escapeString
(byte[] bytes) Escapes abyte
array according to the PDF conventions.static void
escapeString
(byte[] bytes, ByteBuffer content) Escapes abyte
array according to the PDF conventions.
-
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 abyte
array according to the PDF conventions.- Parameters:
bytes
- thebyte
array to escape- Returns:
- an escaped
byte
array
-
escapeString
Escapes abyte
array according to the PDF conventions.- Parameters:
bytes
- thebyte
array 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
-