Package org.apache.juneau.swaps
Class ByteArraySwap.SpacedHex
java.lang.Object
org.apache.juneau.swap.ObjectSwap<T,String>
org.apache.juneau.swap.StringSwap<byte[]>
org.apache.juneau.swaps.ByteArraySwap
org.apache.juneau.swaps.ByteArraySwap.SpacedHex
- Enclosing class:
- ByteArraySwap
Converts byte arrays to spaced-hex encoding.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.swaps.ByteArraySwap
ByteArraySwap.Base64, ByteArraySwap.Hex, ByteArraySwap.SpacedHex -
Field Summary
Fields inherited from class org.apache.juneau.swap.ObjectSwap
NULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionswap(BeanSession session, byte[] b) Converts the specifiedto abyte []String.byte[]unswap(BeanSession session, String s, ClassMeta<?> hint) Converts the specifiedStringto a.byte []Methods inherited from class org.apache.juneau.swap.ObjectSwap
forMediaTypes, forMediaTypes, getNormalClass, getSwapClass, getSwapClassMeta, isNormalObject, isSwappedObject, match, swap, toString, unswap, withTemplate, withTemplate
-
Constructor Details
-
SpacedHex
public SpacedHex()
-
-
Method Details
-
swap
Converts the specifiedto abyte []String.- Overrides:
swapin classStringSwap<byte[]>- Parameters:
session- The bean session to use to get the class meta. This is always going to be the same bean context that created this swap.b- The object to be transformed.- Returns:
- The transformed object.
- Throws:
Exception- If a problem occurred trying to convert the output.
-
unswap
Converts the specifiedStringto a.byte []- Overrides:
unswapin classStringSwap<byte[]>- Parameters:
session- The bean session to use to get the class meta. This is always going to be the same bean context that created this swap.s- The transformed object.hint- If possible, the parser will try to tell you the object type being created. For example, on a serialized date, this may tell you that the object being created must be of typeGregorianCalendar.
This may benull if the parser cannot make this determination.- Returns:
- The narrowed object.
- Throws:
Exception- If this method is not implemented.
-