com.voytechs.jnetstream.primitive
Class HexdumpPrimitive
java.lang.Object
com.voytechs.jnetstream.primitive.AbstractAddressPrimitive
com.voytechs.jnetstream.primitive.HexdumpPrimitive
- All Implemented Interfaces:
- MutablePrimitive, Primitive, PrimitiveDisplay, PrimitiveFactory, ProtocolPrimitive, ProtocolPrimitiveFactory
public class HexdumpPrimitive
- extends AbstractAddressPrimitive
| Methods inherited from class com.voytechs.jnetstream.primitive.AbstractAddressPrimitive |
equals, getByteOrder, getRadix, getSign, getSize, hashCode, main, setCustom, setRadix, setSeparator, setSize, setValue, toBinString, 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
HexdumpPrimitive
public HexdumpPrimitive()
- Parameters:
-
- Throws:
HexdumpPrimitive
public HexdumpPrimitive(int size,
boolean sign)
throws PrimitiveException
- Throws:
PrimitiveException
HexdumpPrimitive
public HexdumpPrimitive(int size,
boolean sign,
int byteOrder)
throws PrimitiveException
- Throws:
PrimitiveException
checkBoundaries
protected void checkBoundaries(java.lang.String name)
throws PrimitiveException
- Overrides:
checkBoundaries in class AbstractAddressPrimitive
- Throws:
PrimitiveException
setValue
public void setValue(PacketInputStream in)
throws java.io.IOException,
EOPacket,
EOPacketStream,
PrimitiveException
- 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
PrimitiveException
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
isMultiLine
public boolean isMultiLine()
- Specified by:
isMultiLine in interface PrimitiveDisplay- Overrides:
isMultiLine in class AbstractAddressPrimitive
toString
public java.lang.String toString()
- Specified by:
toString in interface PrimitiveDisplay- Overrides:
toString in class AbstractAddressPrimitive
toString
public java.lang.String toString(java.lang.String prefix,
boolean indentFirstLine)
- Specified by:
toString in interface PrimitiveDisplay- Overrides:
toString in class AbstractAddressPrimitive
toBin
public java.lang.String toBin(byte[] a)
- Overrides:
toBin in class AbstractAddressPrimitive
getValue
public java.lang.Object getValue()
- Returns the value of this hexdump primitive as byte[].
- Specified by:
getValue in interface Primitive- Overrides:
getValue in class AbstractAddressPrimitive
- Returns:
- byte[] buffer of all the data contained within this hexdump primitive.
getName
public java.lang.String getName()