Package com.adaptris.util.text
Class ByteTranslator
- java.lang.Object
-
- com.adaptris.util.text.ByteTranslator
-
- Direct Known Subclasses:
Base58ByteTranslator
,Base64ByteTranslator
,CharsetByteTranslator
,HexStringByteTranslator
,SimpleByteTranslator
public abstract class ByteTranslator extends java.lang.Object
Abstract Base class for converting strings into bytes and vice versa.
-
-
Constructor Summary
Constructors Constructor Description ByteTranslator()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.String
translate(byte[] bytes)
Translate a byte array into a String.abstract byte[]
translate(java.lang.String s)
Translate a string into a byte array.
-
-
-
Method Detail
-
translate
public abstract byte[] translate(java.lang.String s) throws java.io.IOException
Translate a string into a byte array.- Parameters:
s
- the string.- Returns:
- the byte array
- Throws:
java.io.IOException
- wrapping any underlying exception
-
translate
public abstract java.lang.String translate(byte[] bytes) throws java.io.IOException
Translate a byte array into a String.- Parameters:
bytes
- the byte array.- Returns:
- the string
- Throws:
java.io.IOException
- wrapping any underlying exception
-
-