Package morfologik.fsa
Class FSAHeader
- java.lang.Object
-
- morfologik.fsa.FSAHeader
-
public final class FSAHeader extends java.lang.ObjectStandard FSA file header, as described infsapackage documentation.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intFSA_MAGICFSA magic (4 bytes).(package private) static intMAX_HEADER_LENGTHMaximum length of the header block.(package private) byteversionFSA version number.
-
Constructor Summary
Constructors Constructor Description FSAHeader(byte version)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FSAHeaderread(java.io.InputStream in)Read FSA header and version from a stream, consuming read bytes.static voidwrite(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
FSAHeaderwith 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.IOExceptionWrites FSA magic bytes and version information.- Parameters:
os- The stream to write to.version- Automaton version.- Throws:
java.io.IOException- Rethrown if writing fails.
-
-