Package megamek.common.net.marshalling
Class PacketMarshaller
java.lang.Object
megamek.common.net.marshalling.PacketMarshaller
Generic marshaller that [un]marshalls the
Packet-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intJava native serialization marshalling -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Deprecated, for removal: This API element is subject to removal in a future version.abstract voidmarshall(Packet packet, OutputStream stream) Marshalls the packet data into the givenOutputStreamunmarshall(byte... data) Deprecated, for removal: This API element is subject to removal in a future version.abstract Packetunmarshall(InputStream stream) Unmarshalls the packet data from the givenInputStream
-
Field Details
-
NATIVE_SERIALIZATION_MARSHALING
public static final int NATIVE_SERIALIZATION_MARSHALINGJava native serialization marshalling- See Also:
-
-
Constructor Details
-
PacketMarshaller
public PacketMarshaller()
-
-
Method Details
-
marshall
Deprecated, for removal: This API element is subject to removal in a future version.Marshalls the packet data into thebyte[]- Parameters:
packet- packet to marshall- Returns:
- marshalled representation of the given
Packet
-
marshall
Marshalls the packet data into the givenOutputStream- Parameters:
packet- packet to marshallstream-OutputStreamto marshall thePacketto- Throws:
Exception
-
unmarshall
Deprecated, for removal: This API element is subject to removal in a future version.Unmarshalls the packet data from the givenbyte[]array- Parameters:
data-byte[]array to unmarshall the packet from- Returns:
- the new
Packetunmarshalled from the givenbyte[]array
-
unmarshall
Unmarshalls the packet data from the givenInputStream- Parameters:
stream-InputStreamto unmarshall the packet from- Returns:
- the new
Packetunmarshalled from the givenInputStream - Throws:
Exception
-