Mercurial Hosting > luan
changeset 2012:72e9624a21d3 default tip
fix flush
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 06 Sep 2025 14:47:09 -0600 |
parents | 9e0cf623ecc5 |
children | |
files | src/luan/impl/LuanStringWriter.java src/luan/modules/IoLuan.java |
diffstat | 2 files changed, 18 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/luan/impl/LuanStringWriter.java Sat Sep 06 02:01:39 2025 -0600 +++ b/src/luan/impl/LuanStringWriter.java Sat Sep 06 14:47:09 2025 -0600 @@ -11,15 +11,16 @@ public final class LuanStringWriter implements IoLuan.LuanWriter { private final Writer out = new StringWriter(); - public Object out() { + @Override public Object out() { return out; } - public void write(Luan luan,Object... args) throws LuanException, IOException { + @Override public void write(Luan luan,Object... args) throws LuanException, IOException { for( Object obj : args ) { out.write( luan.luanToString(obj) ); } } - public void close() {} + @Override public void close() {} + @Override public void flush() {} }
--- a/src/luan/modules/IoLuan.java Sat Sep 06 02:01:39 2025 -0600 +++ b/src/luan/modules/IoLuan.java Sat Sep 06 14:47:09 2025 -0600 @@ -53,26 +53,27 @@ public Object out(); public void write(Luan luan,Object... args) throws LuanException, IOException; public void close() throws IOException; + public void flush() throws IOException; } public static LuanWriter luanWriter(final PrintStream out) { return new LuanWriter() { - public Object out() { + @Override public Object out() { return out; } - public void write(Luan luan,Object... args) throws LuanException { + @Override public void write(Luan luan,Object... args) throws LuanException { for( Object obj : args ) { out.print( luan.luanToString(obj) ); } } - public void flush() { + @Override public void flush() { out.flush(); } - public void close() { + @Override public void close() { out.close(); } }; @@ -81,21 +82,21 @@ public static LuanWriter luanWriter(final Writer out) { return new LuanWriter() { - public Object out() { + @Override public Object out() { return out; } - public void write(Luan luan,Object... args) throws LuanException, IOException { + @Override public void write(Luan luan,Object... args) throws LuanException, IOException { for( Object obj : args ) { out.write( luan.luanToString(obj) ); } } - public void flush() throws IOException { + @Override public void flush() throws IOException { out.flush(); } - public void close() throws IOException { + @Override public void close() throws IOException { out.close(); } }; @@ -395,19 +396,21 @@ return new LuanWriter() { private final Writer out = new StringWriter(); - public Object out() { + @Override public Object out() { return out; } - public void write(Luan luan,Object... args) throws LuanException, IOException { + @Override public void write(Luan luan,Object... args) throws LuanException, IOException { for( Object obj : args ) { out.write( luan.luanToString(obj) ); } } - public void close() throws IOException { + @Override public void close() throws IOException { s = out.toString(); } + + @Override public void flush() {} }; } }