Class InputStreamSwap.Hex

Enclosing class:
InputStreamSwap

public static class InputStreamSwap.Hex extends InputStreamSwap
Converts InputStreams to hex encoding.
  • Constructor Details

    • Hex

      public Hex()
  • Method Details

    • swap

      public String swap(BeanSession session, InputStream is) throws Exception
      Converts the specified InputStream to a String.
      Overrides:
      swap in class StringSwap<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

      public InputStream unswap(BeanSession session, String s, ClassMeta<?> hint) throws Exception
      Converts the specified String to an InputStream.
      Overrides:
      unswap in class StringSwap<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 type GregorianCalendar.
      This may be null if the parser cannot make this determination.
      Returns:
      The narrowed object.
      Throws:
      Exception - If this method is not implemented.