From 54d99cc25a29ca9cf7480e5924c72d7fda08522b Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Mon, 13 Dec 2021 15:00:40 -0300 Subject: [PATCH] Replace UTF-8 String with StandardCharsets.UTF_8 Aligned line references too --- docs/src/main/asciidoc/vertx.adoc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/src/main/asciidoc/vertx.adoc b/docs/src/main/asciidoc/vertx.adoc index 4e16d90a97b24..7e8829a801944 100644 --- a/docs/src/main/asciidoc/vertx.adoc +++ b/docs/src/main/asciidoc/vertx.adoc @@ -141,11 +141,11 @@ Then, in the `VertxResource` file add the following method: [source, java] ---- -@GET // <1> +@GET // <1> @Path("/lorem") -public Uni readShortFile() { // <2> - return vertx.fileSystem().readFile("lorem.txt") // <3> - .onItem().transform(content -> content.toString("UTF-8")); // <4> +public Uni readShortFile() { // <2> + return vertx.fileSystem().readFile("lorem.txt") // <3> + .onItem().transform(content -> content.toString(StandardCharsets.UTF_8)); // <4> } ---- 1. This endpoint handles HTTP `GET` request on path `/lorem` (so the full path will be `vertx/lorem`) @@ -211,13 +211,13 @@ Add the following method to the `VertxResource` class: ---- @GET @Path("/book") -public Multi readLargeFile() { // <1> - return vertx.fileSystem().open("book.txt", // <2> +public Multi readLargeFile() { // <1> + return vertx.fileSystem().open("book.txt", // <2> new OpenOptions().setRead(true) ) - .onItem().transformToMulti(file -> file.toMulti()) // <3> - .onItem().transform(content -> content.toString("UTF-8") // <4> - + "\n------------\n"); // <5> + .onItem().transformToMulti(file -> file.toMulti()) // <3> + .onItem().transform(content -> content.toString(StandardCharsets.UTF_8)) // <4> + + "\n------------\n"); // <5> } ---- 1. This time, we return a Multi as we want to stream the chunks