public StoreResponseStreamSinkConduit(StreamSinkConduit next, HttpServerExchange exchange) { super(next); this.exchange = exchange; long length = exchange.getResponseContentLength(); if (length <= 0L) { outputStream = new ByteArrayOutputStream(); } else { if (length > Integer.MAX_VALUE) { throw UndertowMessages.MESSAGES.responseTooLargeToBuffer(length); } outputStream = new ByteArrayOutputStream((int) length); } }
/** * Construct a new instance. * * @param next the delegate conduit to set * @param exchange */ public StoredResponseStreamSinkConduit(StreamSinkConduit next, HttpServerExchange exchange) { super(next); this.exchange = exchange; long length = exchange.getResponseContentLength(); if (length <= 0L) { outputStream = new ByteArrayOutputStream(); } else { if (length > Integer.MAX_VALUE) { throw UndertowMessages.MESSAGES.responseTooLargeToBuffer(length); } outputStream = new ByteArrayOutputStream((int) length); } }
/** * Construct a new instance. * * @param next the delegate conduit to set * @param exchange */ public StoredResponseStreamSinkConduit(StreamSinkConduit next, HttpServerExchange exchange) { super(next); this.exchange = exchange; long length = exchange.getResponseContentLength(); if (length <= 0L) { outputStream = new ByteArrayOutputStream(); } else { if (length > Integer.MAX_VALUE) { throw UndertowMessages.MESSAGES.responseTooLargeToBuffer(length); } outputStream = new ByteArrayOutputStream((int) length); } }
/** * Construct a new instance. * * @param next the delegate conduit to set * @param exchange */ public StoredResponseStreamSinkConduit(StreamSinkConduit next, HttpServerExchange exchange) { super(next); this.exchange = exchange; long length = exchange.getResponseContentLength(); if (length <= 0L) { outputStream = new ByteArrayOutputStream(); } else { if (length > Integer.MAX_VALUE) { throw UndertowMessages.MESSAGES.responseTooLargeToBuffer(length); } outputStream = new ByteArrayOutputStream((int) length); } }