Class ByteArraySource

  • All Implemented Interfaces:
    ByteSource, BytesSource, org.refcodes.struct.ByteArrayAccessor

    public class ByteArraySource
    extends Object
    implements BytesSource, org.refcodes.struct.ByteArrayAccessor
    The Class ByteArraySource.
    • Constructor Detail

      • ByteArraySource

        public ByteArraySource()
    • Method Detail

      • transmitByte

        public void transmitByte​(byte aByte)
                          throws IOException
        Writes (sends) a byte.
        Specified by:
        transmitByte in interface ByteSource
        Specified by:
        transmitByte in interface BytesSource
        Parameters:
        aByte - The byte to be pushed.
        Throws:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
      • transmitBytes

        public void transmitBytes​(byte[] aBytes,
                                  int aOffset,
                                  int aLength)
                           throws IOException
        Writes (sends) a byte block.
        Specified by:
        transmitBytes in interface BytesSource
        Parameters:
        aBytes - The byte to be pushed.
        aOffset - The offset from which to take the data.
        aLength - The number of elements to push starting at the given offset.
        Throws:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
      • getBytes

        public byte[] getBytes()
        Specified by:
        getBytes in interface org.refcodes.struct.ByteArrayAccessor