Class CheckedBytes<E extends Exception>

  • Type Parameters:
    E - Exception's type.
    All Implemented Interfaces:
    Bytes

    public final class CheckedBytes<E extends Exception>
    extends Object
    implements Bytes
    Bytes that throws exception of specified type.
    Since:
    0.31
    • Constructor Detail

      • CheckedBytes

        public CheckedBytes​(Bytes orig,
                            Func<? super Exception,​? extends E> fnc)
        Ctor.
        Parameters:
        orig - Origin bytes.
        fnc - Function that wraps exceptions.
    • Method Detail

      • asBytes

        public byte[] asBytes()
                       throws E extends Exception
        Description copied from interface: Bytes
        Convert it to the byte array.
        Specified by:
        asBytes in interface Bytes
        Returns:
        The byte array
        Throws:
        E extends Exception