public abstract class AbstractEncodedMessage extends Object implements EncodedMessage
Note that only full bytes are supported. This means that for example the 300 bits message from GPS sub-frames must be completed with 4 zero bits to reach 304 bits = 38 bytes, even if only the first 300 bits will be decoded and the 4 extra bits in the last byte will be ignored.
Constructor and Description |
---|
AbstractEncodedMessage()
Empty constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
extractBits(int n)
Extract the next n bits from the encoded message.
|
protected abstract int |
fetchByte()
Fetch the next byte from the message.
|
void |
start()
Start message extraction.
|
public AbstractEncodedMessage()
This constructor is not strictly necessary, but it prevents spurious javadoc warnings with JDK 18 and later.
public void start()
start
in interface EncodedMessage
protected abstract int fetchByte()
public long extractBits(int n)
extractBits
in interface EncodedMessage
n
- number of bits to extract (cannot exceed 32 bits)Copyright © 2002-2023 CS GROUP. All rights reserved.