com.voytechs.jnetstream.primitive
Class MacAddressPrimitive
java.lang.Object
com.voytechs.jnetstream.primitive.AbstractAddressPrimitive
com.voytechs.jnetstream.primitive.MacAddressPrimitive
- All Implemented Interfaces:
- MutablePrimitive, Primitive, PrimitiveDisplay, PrimitiveFactory, ProtocolPrimitive, ProtocolPrimitiveFactory
public class MacAddressPrimitive
- extends AbstractAddressPrimitive
| Methods inherited from class com.voytechs.jnetstream.primitive.AbstractAddressPrimitive |
checkBoundaries, equals, getByteOrder, getRadix, getSign, getSize, getValue, hashCode, isMultiLine, setCustom, setRadix, setSeparator, setSize, setValue, toBin, toBinString, toString, toString, write |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
DEFAULT_SIZE
public static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
BYTE_ORDER
public static final int BYTE_ORDER
- See Also:
- Constant Field Values
MacAddressPrimitive
public MacAddressPrimitive()
- Parameters:
-
- Throws:
MacAddressPrimitive
public MacAddressPrimitive(int size,
boolean sign)
throws PrimitiveException
- Throws:
PrimitiveException
MacAddressPrimitive
public MacAddressPrimitive(int size,
boolean sign,
int byteOrder)
throws PrimitiveException
- Throws:
PrimitiveException
MacAddressPrimitive
public MacAddressPrimitive(PacketInputStream in)
throws java.io.IOException,
EOPacket,
EOPacketStream
- Throws:
java.io.IOException
EOPacket
EOPacketStream
setValue
public void setValue(PacketInputStream in)
throws java.io.IOException,
EOPacket,
EOPacketStream
- Sets the value of the primitive from packet stream.
Data is extracted according to the byte order specified.
Also size number of bits are extracted.
Note: Current implementation does not support non standard bit size
in Little endian mode. That is sizes other then 32, 16, or 8 bits in
little endian mode will throw an exception. This should be corrected in
future releases. (Its hard to read bits in non big-endian order, but not impossible.)
- Throws:
java.io.IOException
EOPacket
EOPacketStream
buildPrimitive
public Primitive buildPrimitive(int size,
boolean sign)
throws PrimitiveException
- Throws:
PrimitiveException
buildProtocolPrimitive
public ProtocolPrimitive buildProtocolPrimitive(int size,
boolean sign,
int byteOrder)
throws PrimitiveException
- Throws:
PrimitiveException
toString
public static java.lang.String toString(PacketInputStream in)
throws java.io.IOException,
EOPacket,
EOPacketStream
- Throws:
java.io.IOException
EOPacket
EOPacketStream
longValue
public long longValue()
- Added to support Ethernet2 (src/dst) filters
intValue
public long intValue()
main
public static void main(java.lang.String[] args)
- Test function for MacAddressPrimitive
- Parameters:
args - command line arguments
getName
public java.lang.String getName()