Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
phlppchrtn committed Jun 3, 2024
1 parent e51bdb7 commit 9eb6122
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void trace(final String category, final String name, final Consume
}

public static <O> O traceWithReturn(final String category, final String name, final Function<Tracer, O> function, final Consumer<TraceSpan> onCloseConsumer) {
try (TracerImpl tracer = createTracer(category, name, onCloseConsumer)) {
try (final TracerImpl tracer = createTracer(category, name, onCloseConsumer)) {
try {
final O result = function.apply(tracer);
tracer.markAsSucceeded();
Expand Down
16 changes: 8 additions & 8 deletions vertigo-core/src/main/java/io/vertigo/core/lang/DataStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
*/
public interface DataStream {
default byte[] getBytes() {
try (final InputStream inputStream = createInputStream()) {
try (final ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
int nRead;
final byte[] data = new byte[16384];
while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
return buffer.toByteArray();
try (
final InputStream inputStream = createInputStream();
final ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
int nRead;
final byte[] data = new byte[16384];
while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
return buffer.toByteArray();
} catch (final IOException e) {
throw WrappedException.wrap(e);
}
Expand Down

0 comments on commit 9eb6122

Please sign in to comment.