public class BinaryAutomataWriter extends Object implements GenericWriter<Automaton>
Responsible for writing an automaton in a binary format to an output stream. Obviously, it cannot know how to handle the supplementary data that can be provided as part of a state. Therefore, if the automaton contains states which have supplementary data, the client is expected to deal with this.
NOTE: By default, this class completely ignores any supplementary
data. To allow writing this data, the client should extend this class and
overwrite the method write(Automata.State). In such case, it is
recommended that super.write(state) is called before writing the
supplementary data. In other words, the standard information (i.e. kind and
children) for a state comes first, and the supplementary data is placed after
that.
| Modifier and Type | Field and Description |
|---|---|
protected wyfs.io.BinaryOutputStream |
writer |
| Constructor and Description |
|---|
BinaryAutomataWriter(wyfs.io.BinaryOutputStream writer) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
protected void |
write(Automaton.State state) |
void |
write(Automaton automaton) |
public BinaryAutomataWriter(wyfs.io.BinaryOutputStream writer)
public void write(Automaton automaton) throws IOException
write in interface GenericWriter<Automaton>IOExceptionprotected void write(Automaton.State state) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface GenericWriter<Automaton>IOExceptionpublic void flush()
throws IOException
flush in interface GenericWriter<Automaton>IOExceptionCopyright © 2017. All rights reserved.