Creates an instance by converting the characters to a byte array (assumes UTF-8 encoding).
Creates an instance by converting the string to a byte array (assumes UTF-8 encoding).
Creates an instance using the sources bytes directly - it does not create a copy of the argument's byte array.
Returns {@code true} if the specified object is a recognized data type that can be easily converted to bytes by instances of this class, {@code false} otherwise. <p/> This implementation returns {@code true} IFF the specified object is an instance of one of the following types: <ul> <li>{@code byte[]}</li> <li>{@code char[]}</li> <li>{@link ByteSource}</li> <li>{@link string}</li> <li>{@link File}</li> </li>{@link InputStream}</li> </ul>
Returns the wrapped byte array.
Returns the <a href="http://en.wikipedia.org/wiki/Hexadecimal">Hex</a>-formatted string representation of the underlying wrapped byte array.
Returns the <a href="http://en.wikipedia.org/wiki/Base64">Base 64</a>-formatted string representation of the underlying wrapped byte array.
Returns {@code true} if the underlying wrapped byte array is null or empty (zero length), {@code false} otherwise.
Very simple {@link ByteSource ByteSource} implementation that maintains an internal {@code byte[]} array and uses the {@link Hex Hex} and {@link Base64 Base64} codec classes to support the {@link #toHex() toHex()} and {@link #toBase64() toBase64()} implementations. <p/> The constructors on this class accept the following implicit byte-backed data types and will convert them to a byte-array automatically: <ul> <li>byte[]</li> <li>char[]</li> <li>string</li> <li>{@link ByteSource ByteSource}</li> <li>{@link File File}</li> <li>{@link InputStream InputStream}</li> </ul>
@since 1.0