Package morfologik.fsa
Class FSAHeader
java.lang.Object
morfologik.fsa.FSAHeader
Standard FSA file header, as described in
fsa
package
documentation.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
FSA magic (4 bytes).(package private) static final int
Maximum length of the header block.(package private) final byte
FSA version number. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FSAHeader
read
(InputStream in) Read FSA header and version from a stream, consuming read bytes.static void
write
(OutputStream os, byte version) Writes FSA magic bytes and version information.
-
Field Details
-
FSA_MAGIC
static final int FSA_MAGICFSA magic (4 bytes).- See Also:
-
MAX_HEADER_LENGTH
static final int MAX_HEADER_LENGTHMaximum length of the header block.- See Also:
-
version
final byte versionFSA version number.
-
-
Constructor Details
-
FSAHeader
FSAHeader(byte version)
-
-
Method Details
-
read
Read FSA header and version from a stream, consuming read bytes.- Parameters:
in
- The input stream to read data from.- Returns:
- Returns a valid
FSAHeader
with version information. - Throws:
IOException
- If the stream ends prematurely or if it contains invalid data.
-
write
Writes FSA magic bytes and version information.- Parameters:
os
- The stream to write to.version
- Automaton version.- Throws:
IOException
- Rethrown if writing fails.
-