public class UsAsciiUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Charset |
US_ASCII
US-ASCII
Charset . |
Modifier and Type | Method and Description |
---|---|
static void |
assertEquals(String expected,
byte[] actual)
Asserts the US-ASCII content matches the expected String.
|
static void |
assertEquals(String message,
String expected,
byte[] actual)
Asserts the US-ASCII content matches the expected String.
|
static char |
convertToChar(byte asciiChar)
Converts the input US-ASCII character to a char.
|
static byte[] |
convertToHttp(byte[] ascii)
Ensures that CR characters are followed by a LF.
|
static byte[] |
convertToHttp(String text)
Convenience method to convert to US-ASCII and HTTP form.
|
static String |
convertToString(byte[] ascii)
Converts the input US-ASCII to String.
|
static byte |
convertToUsAscii(char character)
Converts the input character into US-ASCII character.
|
static byte[] |
convertToUsAscii(String text)
Converts the input text into US-ASCII format.
|
static org.easymock.ArgumentsMatcher |
createUsAsciiMatcher()
Creates a
ArgumentsMatcher for method with only one parameter
being US-ASCII characters. |
public static void assertEquals(String message, String expected, byte[] actual)
message
- Message.expected
- Expected text.actual
- Actual US-ASCII text.public static void assertEquals(String expected, byte[] actual)
expected
- Expected text.actual
- Actual US-ASCII text.public static byte[] convertToUsAscii(String text)
text
- Text.public static byte[] convertToHttp(String text)
text
- Text.public static byte[] convertToHttp(byte[] ascii)
ascii
- Ascii content.public static String convertToString(byte[] ascii)
ascii
- US-ASCII.public static char convertToChar(byte asciiChar)
asciiChar
- US-ASCII character.public static byte convertToUsAscii(char character)
character
- Character.public static org.easymock.ArgumentsMatcher createUsAsciiMatcher()
ArgumentsMatcher
for method with only one parameter
being US-ASCII characters.ArgumentsMatcher
.Copyright © 2005–2016. All rights reserved.