Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
checkstyle
  • Loading branch information
elharo committed Oct 7, 2023
commit cd5399224517a9185ddae033b27b2f399c46f720
2 changes: 1 addition & 1 deletion src/main/java/org/apache/commons/io/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3828,7 +3828,7 @@ public static void writeLines(final Collection<?> lines, final String lineEnding
* Writes the {@link #toString()} value of each item in a collection to
* an {@link OutputStream} line by line, using the specified character
* encoding and the specified line ending.
*
*
* UTF-16 is written big-endian with no byte order mark.
* For little endian, use UTF-16LE. For a BOM, write it to the stream
* before calling this method.
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/apache/commons/io/IOUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1763,10 +1763,10 @@ public void testWriteLittleString() throws IOException {

@Test
public void testWriteLines() throws IOException {
String[] data = {"The", "quick"};
ByteArrayOutputStream out = new ByteArrayOutputStream();
final String[] data = {"The", "quick"};
final ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.writeLines(Arrays.asList(data), "\n", out, "UTF-16");
String result = new String(out.toByteArray(), StandardCharsets.UTF_16);
final String result = new String(out.toByteArray(), StandardCharsets.UTF_16);
assertEquals("The\nquick\n", result);
}

Expand Down