/** * Constructs an instance of demarcator with provided {@link InputStream} * and max buffer size and initial buffer size. Each demarcated token must * fit within max buffer size, otherwise the exception will be raised. */ AbstractTextDemarcator(Reader reader, int maxDataSize, int initialBufferSize) { this.validate(reader, maxDataSize, initialBufferSize); this.reader = reader; this.buffer = new char[initialBufferSize]; this.maxDataSize = maxDataSize; }