Package com.iizix.codepage
Class CodepageMapper
java.lang.Object
com.iizix.codepage.CodepageMapper
Maps ASCII to/from Unicode, EBCDIC to/from Unicode, Ansi to/from Unicode.
- Author:
- Christopher Mindus
- See Also:
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionstatic charconvertAnsiToChar(byte b) Converts a single Ansi byte to character.static char[]convertAnsiToChar(byte[] b) Converts an array of Ansi bytes to an array of characters.static StringconvertAnsiToString(byte[] b) Converts an array of Ansi bytes to a string.static StringconvertAnsiToString(byte[] b, int offset, int length) Converts an array of Ansi bytes to a string.static charconvertASCIIToChar(byte b) Converts a single ASCII byte to character.static char[]convertASCIIToChar(byte[] b) Converts an array of ASCII bytes to an array of characters.static StringconvertASCIIToString(byte[] b) Converts an array of ASCII bytes to a string.static StringconvertASCIIToString(byte[] b, int offset, int length) Converts an array of ASCII bytes to a string.static byteconvertCharToAnsi(char c) Converts a single character to Ansi byte.static byte[]convertCharToAnsi(char[] c) Converts an array of characters to an array of Ansi bytes.static byteconvertCharToASCII(char c) Converts a single character to ASCII byte.static byte[]convertCharToASCII(char[] c) Converts an array of characters to an array of ASCII bytes.static byteconvertCharToEBCDIC(char c) Converts a single character to EBCDIC byte.static byte[]convertCharToEBCDIC(char[] c) Converts an array of characters to an array of EBCDIC bytes.static charconvertEBCDICToChar(byte b) Converts a single EBCDIC byte to character.static char[]convertEBCDICToChar(byte[] b) Converts an array of EBCDIC bytes to an array of characters.static StringconvertEBCDICToString(byte[] b) Converts an array of EBCDIC bytes to a string.static StringconvertEBCDICToString(byte[] b, int offset, int length) Converts an array of EBCDIC bytes to a string.static byte[]Converts a string to an array of Ansi bytes.static byte[]Converts a string to an array of ASCII bytes.static byte[]Converts a string to an array of EBCDIC bytes.static CodepageConverterCreates an instance of a codepage converter class.static final CodepageConverterGets the codepage converter for Ansi.static final CodepageConverterGets the codepage converter for ASCII.static intGets the current EBCDIC code page value, e.g.static final CodepageConverterGets the codepage converter for EBCDIC.static booleanSets the Ansi codepage.static booleanSets the ASCII codepage.static booleanSets the EBCDIC codepage.
Constructor Details
CodepageMapper
public CodepageMapper()
Method Details
createCodepageConverter
Creates an instance of a codepage converter class.- Returns:
- null if codepage is not found.
setAnsi
Sets the Ansi codepage.setASCII
Sets the ASCII codepage.setEBCDIC
Sets the EBCDIC codepage.getASCIIConverter
Gets the codepage converter for ASCII.getAnsiConverter
Gets the codepage converter for Ansi.getEBCDICConverter
Gets the codepage converter for EBCDIC.convertAnsiToChar
public static char convertAnsiToChar(byte b) Converts a single Ansi byte to character.convertAnsiToChar
public static char[] convertAnsiToChar(byte[] b) Converts an array of Ansi bytes to an array of characters.convertCharToAnsi
public static byte convertCharToAnsi(char c) Converts a single character to Ansi byte.convertCharToAnsi
public static byte[] convertCharToAnsi(char[] c) Converts an array of characters to an array of Ansi bytes.convertAnsiToString
Converts an array of Ansi bytes to a string.convertAnsiToString
Converts an array of Ansi bytes to a string.convertStringToAnsi
Converts a string to an array of Ansi bytes.convertASCIIToChar
public static char convertASCIIToChar(byte b) Converts a single ASCII byte to character.convertASCIIToChar
public static char[] convertASCIIToChar(byte[] b) Converts an array of ASCII bytes to an array of characters.convertCharToASCII
public static byte convertCharToASCII(char c) Converts a single character to ASCII byte.convertCharToASCII
public static byte[] convertCharToASCII(char[] c) Converts an array of characters to an array of ASCII bytes.convertASCIIToString
Converts an array of ASCII bytes to a string.convertASCIIToString
Converts an array of ASCII bytes to a string.convertStringToASCII
Converts a string to an array of ASCII bytes.convertEBCDICToChar
public static char convertEBCDICToChar(byte b) Converts a single EBCDIC byte to character.convertEBCDICToChar
public static char[] convertEBCDICToChar(byte[] b) Converts an array of EBCDIC bytes to an array of characters.convertCharToEBCDIC
public static byte convertCharToEBCDIC(char c) Converts a single character to EBCDIC byte.convertCharToEBCDIC
public static byte[] convertCharToEBCDIC(char[] c) Converts an array of characters to an array of EBCDIC bytes.convertEBCDICToString
Converts an array of EBCDIC bytes to a string.convertEBCDICToString
Converts an array of EBCDIC bytes to a string.convertStringToEBCDIC
Converts a string to an array of EBCDIC bytes.getCurrentEBCDICCodePage
public static int getCurrentEBCDICCodePage()Gets the current EBCDIC code page value, e.g. 37, 278, 500...