Package org.apache.juneau.swaps
Class InputStreamSwap.Base64
java.lang.Object
org.apache.juneau.swap.ObjectSwap<T,String>
org.apache.juneau.swap.StringSwap<InputStream>
org.apache.juneau.swaps.InputStreamSwap
org.apache.juneau.swaps.InputStreamSwap.Base64
- Enclosing class:
InputStreamSwap
Converts
InputStreams
to BASE-64 encoding.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.swaps.InputStreamSwap
InputStreamSwap.Base64, InputStreamSwap.Hex, InputStreamSwap.SpacedHex
-
Field Summary
Fields inherited from class org.apache.juneau.swap.ObjectSwap
NULL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionswap
(BeanSession session, InputStream is) Converts the specifiedInputStream
to aString
.unswap
(BeanSession session, String s, ClassMeta<?> hint) Converts the specifiedString
to anInputStream
.Methods inherited from class org.apache.juneau.swaps.InputStreamSwap
toBytes, toStream
Methods inherited from class org.apache.juneau.swap.ObjectSwap
forMediaTypes, forMediaTypes, getNormalClass, getSwapClass, getSwapClassMeta, isNormalObject, isSwappedObject, match, swap, toString, unswap, withTemplate, withTemplate
-
Constructor Details
-
Base64
public Base64()
-
-
Method Details
-
swap
Converts the specifiedInputStream
to aString
.- Overrides:
swap
in classStringSwap<InputStream>
- 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.is
- The object to be transformed.- Returns:
- The transformed object.
- Throws:
Exception
- If a problem occurred trying to convert the output.
-
unswap
Converts the specifiedString
to anInputStream
.- Overrides:
unswap
in classStringSwap<InputStream>
- 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.
-