- java.lang.Object
-
- org.refcodes.p2p.AbstractP2PHeader<Integer>
-
- org.refcodes.p2p.alt.serial.SerialP2PHeader
-
- All Implemented Interfaces:
Serializable
,org.refcodes.mixin.DestinationAccessor<Integer>
,org.refcodes.mixin.LengthAccessor
,org.refcodes.mixin.MagicBytesAccessor
,org.refcodes.mixin.MagicNumberAccessor<Integer>
,org.refcodes.p2p.P2PHeader<Integer>
,org.refcodes.serial.Segment
,org.refcodes.serial.Segment.SegmentMixin
,org.refcodes.serial.Transmission
,org.refcodes.serial.Transmission.TransmissionMixin
public class SerialP2PHeader extends org.refcodes.p2p.AbstractP2PHeader<Integer> implements org.refcodes.mixin.MagicNumberAccessor<Integer>, org.refcodes.p2p.P2PHeader<Integer>, org.refcodes.mixin.MagicBytesAccessor, org.refcodes.serial.Segment, org.refcodes.serial.Segment.SegmentMixin
TheSerialP2PHeader
represents aP2PHeader
optimized for local microcontroller wiring (networks) and microcontroller memory layout: The visited hops are serialized and deserialized in the tail of theSerialP2PMessage
as this makes append the last hop easier for devices with small memory buffers.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DestinationAccessor
org.refcodes.mixin.DestinationAccessor.DestinationMutator<DEST extends Object>, org.refcodes.mixin.DestinationAccessor.DestinationProperty<DEST extends Object>
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.MagicBytesAccessor
org.refcodes.mixin.MagicBytesAccessor.MagicBytesBuilder<B extends org.refcodes.mixin.MagicBytesAccessor.MagicBytesBuilder<B>>, org.refcodes.mixin.MagicBytesAccessor.MagicBytesMutator, org.refcodes.mixin.MagicBytesAccessor.MagicBytesProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.MagicNumberAccessor
org.refcodes.mixin.MagicNumberAccessor.MagicNumberBuilder<T extends Object,B extends org.refcodes.mixin.MagicNumberAccessor.MagicNumberBuilder<T,B>>, org.refcodes.mixin.MagicNumberAccessor.MagicNumberMutator<T extends Object>, org.refcodes.mixin.MagicNumberAccessor.MagicNumberProperty<T extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
fromTransmission(org.refcodes.serial.Sequence aSequence, int aOffset)
int
getLength()
byte[]
getMagicBytes()
Integer
getMagicNumber()
void
receiveFrom(InputStream aInputStream, OutputStream aReturnStream)
org.refcodes.serial.Schema
toSchema()
org.refcodes.serial.Sequence
toSequence()
org.refcodes.struct.SimpleTypeMap
toSimpleTypeMap()
void
transmitTo(OutputStream aOutputStream, InputStream aReturnStream)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getMagicBytes
public byte[] getMagicBytes()
- Specified by:
getMagicBytes
in interfaceorg.refcodes.mixin.MagicBytesAccessor
-
getMagicNumber
public Integer getMagicNumber()
- Specified by:
getMagicNumber
in interfaceorg.refcodes.mixin.MagicNumberAccessor<Integer>
-
getLength
public int getLength()
- Specified by:
getLength
in interfaceorg.refcodes.mixin.LengthAccessor
- Specified by:
getLength
in interfaceorg.refcodes.serial.Transmission
-
toSequence
public org.refcodes.serial.Sequence toSequence()
- Specified by:
toSequence
in interfaceorg.refcodes.serial.Transmission
-
transmitTo
public void transmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException
- Specified by:
transmitTo
in interfaceorg.refcodes.serial.Transmission
- Specified by:
transmitTo
in interfaceorg.refcodes.serial.Transmission.TransmissionMixin
- Throws:
IOException
-
toSchema
public org.refcodes.serial.Schema toSchema()
- Specified by:
toSchema
in interfaceorg.refcodes.serial.Transmission
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
- Specified by:
toSimpleTypeMap
in interfaceorg.refcodes.serial.Transmission
-
fromTransmission
public int fromTransmission(org.refcodes.serial.Sequence aSequence, int aOffset) throws org.refcodes.serial.TransmissionException
- Specified by:
fromTransmission
in interfaceorg.refcodes.serial.Segment
- Throws:
org.refcodes.serial.TransmissionException
-
receiveFrom
public void receiveFrom(InputStream aInputStream, OutputStream aReturnStream) throws IOException, org.refcodes.serial.TransmissionException
- Specified by:
receiveFrom
in interfaceorg.refcodes.serial.Segment
- Specified by:
receiveFrom
in interfaceorg.refcodes.serial.Segment.SegmentMixin
- Throws:
IOException
org.refcodes.serial.TransmissionException
-
-