converting byte array gen methods to use ring buffer instead of value