@Test public void sendZipFileCompressionOn() throws IOException { Path path = Files.createTempFile(null, ".zip"); Files.copy(this.getClass().getResourceAsStream("/zipFile.zip"), path, StandardCopyOption.REPLACE_EXISTING); path.toFile().deleteOnExit(); try (FileSystem zipFs = FileSystems.newFileSystem(path, null)) { Path fromZipFile = zipFs.getPath("/largeFile.txt"); long fileSize = Files.size(fromZipFile); assertSendFile(out -> out.compression(true).sendFile(fromZipFile, 0, fileSize), true, -1, (req, res) -> false); } }
.get("/stream", (req, res) -> req.receive() .then(res.compression(true) .options(op -> op.flushOnEach()) .sendString(ep.log()).then())))
.asString() .log() .then(res.compression(false) .sendString(Flux.just("test")).then())) .get("/stream", (req, res) ->