/** * 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. */ AbstractDemarcator(InputStream is, int maxDataSize, int initialBufferSize) { this.validate(is, maxDataSize, initialBufferSize); this.is = is; this.initialBufferSize = initialBufferSize; this.buffer = new byte[initialBufferSize]; this.maxDataSize = maxDataSize; }
/** * 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. */ AbstractDemarcator(InputStream is, int maxDataSize, int initialBufferSize) { this.validate(is, maxDataSize, initialBufferSize); this.is = is; this.initialBufferSize = initialBufferSize; this.buffer = new byte[initialBufferSize]; this.maxDataSize = maxDataSize; }