@Override
        public int read() throws IOException {
            final int result = super.read();
            if (result != -1) {
                if (LOGGER.isDebugEnabled() && byteBuffer.size() > MAX_BUFFER_SIZE) {
                    LOGGER.debug("Exceeding buffer length");
                }

                byteBuffer.write(result);
            }
            return result;
        }
Buffer for reading byte data with a provided encoding
stroom-pipeline/src/main/java/stroom/pipeline/reader/ReaderRecorder.java