Class InputStreamSwap

Direct Known Subclasses:
InputStreamSwap.Base64, InputStreamSwap.Hex, InputStreamSwap.SpacedHex

public abstract class InputStreamSwap extends StringSwap<InputStream>
Transforms InputStreams to Strings.
See Also:
  • Constructor Details

  • Method Details

    • toBytes

      protected byte[] toBytes(InputStream is) throws IOException
      Convert 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.
    • toStream

      protected InputStream toStream(byte[] b, ClassMeta<?> hint)
      Convert 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.