Module id.xfunction

Class XOutputStream

All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class XOutputStream extends ByteArrayOutputStream
Implements an OutputStream by extending ByteArrayOutputStream with methods which allows you to get all written data in one of the formats available.
  • Constructor Details

    • XOutputStream

      public XOutputStream()
  • Method Details

    • asList

      public List<Integer> asList()
      Returns written data in form of List of integers. Writing "abc" will result [97, 98, 99] and "hello" to [104, 101, 108, 108, 111]
    • asHexString

      public String asHexString()
      Returns written data in form of HEX string. Writing "abc" will result to "61, 62, 63" and "hello" to "68, 65, 6c, 6c, 6f".

      Each byte always encoded with 2 symbols (padded with 0)