List of usage examples for io.vertx.core.buffer Buffer slice
Buffer slice();
From source file:com.hubrick.vertx.s3.util.ChunkedBufferReadStream.java
License:Apache License
private void writeChunk(boolean resumed) { if (!paused) { try {/*from w w w .ja v a 2 s .c o m*/ while (!lastChunks.isEmpty()) { final Buffer currentChunk = lastChunks.pop(); if (currentChunk.length() > 0) { if (handler != null) { handler.handle(currentChunk.slice()); } } } if (endCalled && !endHandled) { endHandled = true; if (endHandler != null) { endHandler.handle(null); } } } catch (Throwable t) { pause(); if (exceptionHandler != null) { exceptionHandler.handle(t); } } } else if (resumed) { writeChunkAsync(resumed); } }