- java.lang.Object
-
- org.mal_lang.langspec.io.LangWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class LangWriter extends Object implements Closeable
WritesLangobjects into.marfiles.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description LangWriter(OutputStream out)Constructs a newLangWriterobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this stream and releases any system resources associated with it.voidwrite(Lang lang)Writes the specifiedLangobject to the output source.
-
-
-
Constructor Detail
-
LangWriter
public LangWriter(OutputStream out)
Constructs a newLangWriterobject.- Parameters:
out- an output stream to which a.marfile is to be written- Throws:
NullPointerException- ifoutisnull- Since:
- 1.0.0
-
-
Method Detail
-
write
public void write(Lang lang) throws IOException
Writes the specifiedLangobject to the output source. This method needs to be called only once for a writer instance.- Parameters:
lang-Langobject that is to be written to the output source- Throws:
NullPointerException- iflangisnullIOException- if an I/O error occursIllegalStateException- ifwriteorclosemethod is already called- Since:
- 1.0.0
-
close
public void close() throws IOExceptionCloses this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an I/O error occurs- Since:
- 1.0.0
-
-