Package org.apache.juneau.swaps
Class InputStreamSwap
- Direct Known Subclasses:
- InputStreamSwap.Base64,- InputStreamSwap.Hex,- InputStreamSwap.SpacedHex
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classConvertsInputStreamsto BASE-64 encoding.static classConvertsInputStreamsto hex encoding.static classConvertsInputStreamsto spaced-hex encoding.
- 
Field SummaryFields inherited from class org.apache.juneau.swap.ObjectSwapNULL
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected byte[]toBytes(InputStream is) Convert the specified input stream to a byte array.protected InputStreamConvert the specified byte array into an input stream.Methods inherited from class org.apache.juneau.swap.StringSwapswap, unswapMethods inherited from class org.apache.juneau.swap.ObjectSwapforMediaTypes, forMediaTypes, getNormalClass, getSwapClass, getSwapClassMeta, isNormalObject, isSwappedObject, match, swap, toString, unswap, withTemplate, withTemplate
- 
Constructor Details- 
InputStreamSwappublic InputStreamSwap()
 
- 
- 
Method Details- 
toBytesConvert the specified input stream to a byte array.- Parameters:
- is- The input stream to convert to bytes.
 Can be- null .
 The stream is automatically closed.
- Returns:
- The byte array.
- Throws:
- IOException- Thrown by input stream.
 
- 
toStreamConvert the specified byte array into an input stream.- Parameters:
- b- The byte array.
- hint- Contains a hint about what subtype is being requested.
- Returns:
- The byte array.
 
 
-