Class Intercom.RingBuffer

  • Enclosing class:

    private static class Intercom.RingBuffer
    extends java.lang.Object
    This RingBuffer is an unprotected circular buffer used to move byte data to and from streams.
    • Field Detail

      • ringBuffer

        private final byte[] ringBuffer
        The RingBuffer's buffer
      • head

        private int head
        The head of the buffer where data is read from first
      • tail

        private int tail
        The tail of the buffer where new data is written to the buffer
    • Constructor Detail

      • RingBuffer

        public RingBuffer​(int bufSize)
        Creates a new RingBuffer of the specified size in bytes
        bufSize - number of bytes of space in the buffer