Class SMFB2ParsingSectionHeader
- java.lang.Object
-
- com.io7m.smfj.format.binary2.internal.SMFB2ParsingSectionHeader
-
- All Implemented Interfaces:
SMFB2StructureParserType<SMFB2Section>
public final class SMFB2ParsingSectionHeader extends java.lang.Object implements SMFB2StructureParserType<SMFB2Section>
A parser that can parse the section header for an arbitrary section.
-
-
Constructor Summary
Constructors Constructor Description SMFB2ParsingSectionHeader()
Construct a parser.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
checkHeader(SMFB2ParsingContextType context, com.io7m.jbssio.api.BSSReaderType reader, SMFB2Section header, long expectedMagic, java.lang.String name)
Check thatheader
has the expected ID.SMFB2Section
parse(SMFB2ParsingContextType context)
-
-
-
Method Detail
-
checkHeader
public static boolean checkHeader(SMFB2ParsingContextType context, com.io7m.jbssio.api.BSSReaderType reader, SMFB2Section header, long expectedMagic, java.lang.String name)
Check thatheader
has the expected ID. Publish an error tocontext
if it does not.- Parameters:
context
- The parsing contextreader
- The current readerheader
- The headerexpectedMagic
- The expected magic numbername
- The name of the header section- Returns:
true
if the header has the expected value
-
parse
public SMFB2Section parse(SMFB2ParsingContextType context) throws java.io.IOException
- Specified by:
parse
in interfaceSMFB2StructureParserType<SMFB2Section>
- Throws:
java.io.IOException
-
-