Skip to content

Commit

Permalink
replace bytearrayoutputstream with outputstream
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-toepfer committed Dec 11, 2023
1 parent 994193c commit f71f786
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import io.github.sebastiantoepfer.ddd.common.Printable;
import jakarta.json.Json;
import jakarta.json.stream.JsonGenerator;
import java.io.ByteArrayOutputStream;
import java.io.Flushable;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Objects;
import java.util.function.Function;

Expand All @@ -37,15 +37,15 @@ public final class JsonArrayStreamMediaPrintableAdapter implements Flushable, Au
private final JsonGenerator generator;
private final Function<JsonObjectStreamMedia, TerminableMedia<?>> mediaDecorator;

public JsonArrayStreamMediaPrintableAdapter(final ByteArrayOutputStream baos) {
this(baos, m -> m);
public JsonArrayStreamMediaPrintableAdapter(final OutputStream os) {
this(os, m -> m);
}

public JsonArrayStreamMediaPrintableAdapter(
final ByteArrayOutputStream baos,
final OutputStream os,
final Function<JsonObjectStreamMedia, TerminableMedia<?>> mediaDecorator
) {
this(Json.createGenerator(baos), mediaDecorator);
this(Json.createGenerator(os), mediaDecorator);
}

private JsonArrayStreamMediaPrintableAdapter(
Expand Down

0 comments on commit f71f786

Please sign in to comment.