Package org.apache.shiro.util
Interface ByteSource
-
- All Known Subinterfaces:
Hash
- All Known Implementing Classes:
AbstractHash
,Md2Hash
,Md5Hash
,Sha1Hash
,Sha256Hash
,Sha384Hash
,Sha512Hash
,SimpleByteSource
,SimpleHash
public interface ByteSource
AByteSource
wraps a byte array and provides additional encoding operations. Most users will find theByteSource.Util
inner class sufficient to construct ByteSource instances.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ByteSource.Util
Utility class that can construct ByteSource instances.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
getBytes()
Returns the wrapped byte array.boolean
isEmpty()
Returnstrue
if the underlying wrapped byte array is null or empty (zero length),false
otherwise.String
toBase64()
Returns the Base 64-formatted String representation of the underlying wrapped byte array.String
toHex()
Returns the Hex-formatted String representation of the underlying wrapped byte array.
-
-
-
Method Detail
-
getBytes
byte[] getBytes()
Returns the wrapped byte array.- Returns:
- the wrapped byte array.
-
toHex
String toHex()
Returns the Hex-formatted String representation of the underlying wrapped byte array.- Returns:
- the Hex-formatted String representation of the underlying wrapped byte array.
-
toBase64
String toBase64()
Returns the Base 64-formatted String representation of the underlying wrapped byte array.- Returns:
- the Base 64-formatted String representation of the underlying wrapped byte array.
-
isEmpty
boolean isEmpty()
Returnstrue
if the underlying wrapped byte array is null or empty (zero length),false
otherwise.- Returns:
true
if the underlying wrapped byte array is null or empty (zero length),false
otherwise.- Since:
- 1.2
-
-