- java.lang.Object
-
- org.mal_lang.langspec.io.LangWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class LangWriter extends Object implements Closeable
WritesLang
objects into.mar
files.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description LangWriter(OutputStream out)
Constructs a newLangWriter
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this stream and releases any system resources associated with it.void
write(Lang lang)
Writes the specifiedLang
object to the output source.
-
-
-
Constructor Detail
-
LangWriter
public LangWriter(OutputStream out)
Constructs a newLangWriter
object.- Parameters:
out
- an output stream to which a.mar
file is to be written- Throws:
NullPointerException
- ifout
isnull
- Since:
- 1.0.0
-
-
Method Detail
-
write
public void write(Lang lang) throws IOException
Writes the specifiedLang
object to the output source. This method needs to be called only once for a writer instance.- Parameters:
lang
-Lang
object that is to be written to the output source- Throws:
NullPointerException
- iflang
isnull
IOException
- if an I/O error occursIllegalStateException
- ifwrite
orclose
method is already called- Since:
- 1.0.0
-
close
public void close() throws IOException
Closes 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- if an I/O error occurs- Since:
- 1.0.0
-
-