return new NOPOutputStream(); } else { return new VertxOutputStream(response);
/** * {@inheritDoc} */ @Override public void write(byte[] b, int off, int len) throws IOException { checkState(); if (off == 0 && len == b.length) { buffer.appendBytes(b); } else { buffer.appendBytes(Arrays.copyOfRange(b, off, off + len)); } }
return new NOPOutputStream(); } else { return new VertxOutputStream(response);
return new NOPOutputStream(); } else { return new VertxOutputStream(response);
/** * {@inheritDoc} */ @Override public void write(byte[] b) throws IOException { checkState(); buffer.appendBytes(b); }
/** * {@inheritDoc} */ @Override public void write(int b) throws IOException { checkState(); buffer.appendByte((byte) b); }
/** * {@inheritDoc} */ @Override public void flush() throws IOException { checkState(); // Only flush to underlying very.x response if the content-length has been set if (buffer.length() > 0 && response.headers().contains(HttpHeaders.CONTENT_LENGTH)) { response.write(buffer); buffer = Buffer.buffer(); } }
/** * {@inheritDoc} */ @Override public void write(byte[] b) throws IOException { checkState(); buffer.appendBytes(b); }
/** * {@inheritDoc} */ @Override public void write(byte[] b, int off, int len) throws IOException { checkState(); if (off == 0 && len == b.length) { buffer.appendBytes(b); } else { buffer.appendBytes(Arrays.copyOfRange(b, off, off + len)); } }
/** * {@inheritDoc} */ @Override public void flush() throws IOException { checkState(); // Only flush to underlying very.x response if the content-length has been set if (buffer.length() > 0 && response.headers().contains(HttpHeaders.CONTENT_LENGTH)) { response.write(buffer); buffer = Buffer.buffer(); } }
/** * {@inheritDoc} */ @Override public void write(int b) throws IOException { checkState(); buffer.appendByte((byte) b); }
/** * {@inheritDoc} */ @Override public void write(byte[] b) throws IOException { checkState(); buffer.appendBytes(b); }
/** * {@inheritDoc} */ @Override public void flush() throws IOException { checkState(); // Only flush to underlying very.x response if the content-length has been set if (buffer.length() > 0 && response.headers().contains(HttpHeaders.CONTENT_LENGTH)) { response.write(buffer); buffer = new Buffer(); } }
/** * {@inheritDoc} */ @Override public void write(byte[] b, int off, int len) throws IOException { checkState(); if (off == 0 && len == b.length) { buffer.appendBytes(b); } else { buffer.appendBytes(Arrays.copyOfRange(b, off, off + len)); } }
/** * {@inheritDoc} */ @Override public void write(int b) throws IOException { checkState(); buffer.appendByte((byte) b); }