Package morfologik.fsa
Class FSAHeader
- java.lang.Object
-
- morfologik.fsa.FSAHeader
-
public final class FSAHeader extends java.lang.Object
Standard FSA file header, as described infsa
package documentation.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
FSA_MAGIC
FSA magic (4 bytes).(package private) static int
MAX_HEADER_LENGTH
Maximum length of the header block.(package private) byte
version
FSA version number.
-
Constructor Summary
Constructors Constructor Description FSAHeader(byte version)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FSAHeader
read(java.io.InputStream in)
Read FSA header and version from a stream, consuming read bytes.static void
write(java.io.OutputStream os, byte version)
Writes FSA magic bytes and version information.
-
-
-
Field Detail
-
FSA_MAGIC
static final int FSA_MAGIC
FSA magic (4 bytes).- See Also:
- Constant Field Values
-
MAX_HEADER_LENGTH
static final int MAX_HEADER_LENGTH
Maximum length of the header block.- See Also:
- Constant Field Values
-
version
final byte version
FSA version number.
-
-
Method Detail
-
read
public static FSAHeader read(java.io.InputStream in) throws java.io.IOException
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:
java.io.IOException
- If the stream ends prematurely or if it contains invalid data.
-
write
public static void write(java.io.OutputStream os, byte version) throws java.io.IOException
Writes FSA magic bytes and version information.- Parameters:
os
- The stream to write to.version
- Automaton version.- Throws:
java.io.IOException
- Rethrown if writing fails.
-
-