Skip to content

Commit 795295b

Browse files
gab1onectrueden
authored andcommitted
DataHandle: add writeLine(String) method
This is analogous to readLine().
1 parent 5b1d44f commit 795295b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/org/scijava/io/handle/DataHandle.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,17 @@ default String findString(final boolean saveString, final int blockSize,
411411
return saveString ? out.toString() : null;
412412
}
413413

414+
/**
415+
* Writes the provided string, followed by a newline character.
416+
*
417+
* @param string The string to write.
418+
* @throws IOException If an I/O error occurs.
419+
*/
420+
default void writeLine(final String string) throws IOException {
421+
writeBytes(string);
422+
writeBytes("\n");
423+
}
424+
414425
// -- InputStream look-alikes --
415426

416427
/**

0 commit comments

Comments
 (0)