From 926a61500dbfe571913beff9babee6e8f6842bf2 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Tue, 29 Apr 2025 19:03:04 -0700 Subject: [PATCH 1/2] Add missing Javadoc. JAVA-5816 --- bson/src/main/org/bson/io/OutputBuffer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bson/src/main/org/bson/io/OutputBuffer.java b/bson/src/main/org/bson/io/OutputBuffer.java index e0a1a314017..dcdd23da373 100644 --- a/bson/src/main/org/bson/io/OutputBuffer.java +++ b/bson/src/main/org/bson/io/OutputBuffer.java @@ -197,6 +197,14 @@ public void writeLong(final long value) { writeInt64(value); } + /** + * Writes the characters of a string to the output buffer as UTF-8 bytes. + * + * @param str the string to write. + * @param checkForNullCharacters if true, check for and disallow null characters in the string. + * @return the total number of bytes written. + * @throws BsonSerializationException if checkForNullCharacters is true and the string contains a null character. + */ protected int writeCharacters(final String str, final boolean checkForNullCharacters) { int len = str.length(); int total = 0; From 3b5e9c6fa519d4f832c964dd0668328b1bd157ab Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Tue, 29 Apr 2025 19:05:43 -0700 Subject: [PATCH 2/2] Remove output to alight with Javadoc on other methods. JAVA-5816 --- bson/src/main/org/bson/io/OutputBuffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bson/src/main/org/bson/io/OutputBuffer.java b/bson/src/main/org/bson/io/OutputBuffer.java index dcdd23da373..d4ae12d4245 100644 --- a/bson/src/main/org/bson/io/OutputBuffer.java +++ b/bson/src/main/org/bson/io/OutputBuffer.java @@ -198,7 +198,7 @@ public void writeLong(final long value) { } /** - * Writes the characters of a string to the output buffer as UTF-8 bytes. + * Writes the characters of a string to the buffer as UTF-8 bytes. * * @param str the string to write. * @param checkForNullCharacters if true, check for and disallow null characters in the string.