From 0e760dbc9773a66739d7225ccffaf7d9164066f9 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 31 Oct 2023 17:57:34 -0400 Subject: [PATCH] Update KiotaSerialization.java --- .../com/microsoft/kiota/serialization/KiotaSerialization.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java index ed58c18e..db29d65e 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java @@ -76,7 +76,7 @@ public static InputStream serializeAsStream(@Nonnull final @Nonnull public static String serializeAsString(@Nonnull final String contentType, @Nonnull final Iterable values) throws IOException { try(final InputStream stream = serializeAsStream(contentType, values)) { - return new String(stream.readAllBytes(), CHARSET_NAME); + return new String(Compatibility.readAllBytes(stream), CHARSET_NAME); } } private static SerializationWriter getSerializationWriter(@Nonnull final String contentType, @Nonnull final Object value) {