|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.pkt.PktConstants
public final class PktConstants
Class containing package wide constant definitions.
This class contains constant definitions for use by this package.
Field Summary | |
---|---|
static int |
DESERIALIZE_POLICY_DEFAULT
Deserialization policy - Use default. |
static int |
DESERIALIZE_POLICY_HEADER_COPY_BODY_COPY
Deserialization policy - Copy both the packet header and body. |
static int |
DESERIALIZE_POLICY_HEADER_COPY_BODY_SLICE
Deserialization policy - Copy packet header, slice packet body. |
static int |
DESERIALIZE_POLICY_HEADER_SLICE_BODY_SLICE
Derialization policy - Slice packet header, slice packet body. |
static int |
SERIALIZE_POLICY_DEFAULT
Serialization policy - Use default. |
static int |
SERIALIZE_POLICY_HEADER_ATTACH_BODY_ATTACH
Serialization policy - Attach packet header, attach packet body. |
static int |
SERIALIZE_POLICY_HEADER_COPY_BODY_ATTACH
Serialization policy - Copy packet header, attach packet body. |
static int |
SERIALIZE_POLICY_HEADER_COPY_BODY_COPY
Serialization policy - Copy both the packet header and body. |
Constructor Summary | |
---|---|
PktConstants()
|
Method Summary | |
---|---|
static int |
deserializationPolicyFromStr(String policyStr)
Gets a deserialization policy from a string |
static String |
deserializationPolicyToStr(int policy)
Gets a string representation of a deserialization policy |
static int |
serializationPolicyFromStr(String policyStr)
Gets a serialization policy from a string |
static String |
serializationPolicyToStr(int policy)
Gets a string representation of a serialization policy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SERIALIZE_POLICY_DEFAULT
This serialization policy is used to specify to the serialization method to use the serialization policy set for the packet type or packet i.e. the caller does not wish to override what has been configured for the packet type or packet
public static final int SERIALIZE_POLICY_HEADER_COPY_BODY_COPY
This serialiation policy causes the packet to serialize its contents
to the space remaining in the last buffer in the buffer list provided
by the user to the PktPacket.serialize(com.neeve.pkt.PktSerializable.SerializeContext, com.neeve.trace.Tracer)
method. If insufficient
space remains in the last buffer to accomodate the entire packet, a new
buffer is allocated of the same size as the last buffer in the list
and the overlow data is copied to that buffer. With this serialization
mode, there can be atmost one additional buffer in the list upon return
from th serialization method
public static final int SERIALIZE_POLICY_HEADER_COPY_BODY_ATTACH
This serialiation policy causes the packet to serialize its packet
header (including any subheaders) contents to the space remaining in
the last buffer in the buffer list provided by the user to the
PktPacket.serialize(com.neeve.pkt.PktSerializable.SerializeContext, com.neeve.trace.Tracer)
method. If insufficient space remains in
the last buffer to accomodate the entire header, a new buffer is
allocated of size equal to the length of the overlow data and the
overlow data is copied to that buffer. The packet body internal buffers
are then appended to the buffer list. With this serialization mode,
there can be several additional buffers in the list upon return from
the serialization method.
public static final int SERIALIZE_POLICY_HEADER_ATTACH_BODY_ATTACH
This serialiation policy causes the packet header and body internal
buffers to be appended to the buffer list provided by the caller to
the PktPacket.serialize(com.neeve.pkt.PktSerializable.SerializeContext, com.neeve.trace.Tracer)
method. With this serialization mode,
there can be several additional buffers in the list upon return from
the serialization method.
public static final int DESERIALIZE_POLICY_DEFAULT
This deserialization policy is used to specify to the deserialization method to use the deserialization policy set for the packet type or packet i.e. the caller does not wish to override what has been configured for the packet type or packet
public static final int DESERIALIZE_POLICY_HEADER_COPY_BODY_COPY
This deserialiation policy causes the packet to deserialize its contents by copying the header and body data from byte array provided by the user to the deserialize method. Upon return from the deserialize method, the user is free to reuse any of the buffers passed in to the deserialization method.
public static final int DESERIALIZE_POLICY_HEADER_COPY_BODY_SLICE
This deserialiation policy causes the packet to deserialize its contents by copying only the header contents from the byte array provided by the user to the deserialize method. The body contents are deserialized by slicing the byte array (marking out a portion of tha array and holding a reference to that portion). Upon return from the deserialize method, the user cannot reuse any of the buffers passed in to the deserialization method that were used in the deserialization process since portion of those buffers are in use subsequent to returning from the deserialization process.
public static final int DESERIALIZE_POLICY_HEADER_SLICE_BODY_SLICE
This deserialiation policy causes the packet to deserialize its contents slicing the byte array (marking out a portion of tha array and holding a reference to that portion) for both the header and the body contents. Upon return from the deserialize method, the user cannot reuse any of the buffers passed in to the deserialization method that were used in the deserialization process since portion of those buffers are in use subsequent to returning from the deserialization process.
Constructor Detail |
---|
public PktConstants()
Method Detail |
---|
public static String serializationPolicyToStr(int policy)
IllegalArgumentException
- in case an invalid policy is specifiedpublic static int serializationPolicyFromStr(String policyStr)
IllegalArgumentException
- in case an invalid policy string is
specifiedpublic static String deserializationPolicyToStr(int policy)
IllegalArgumentException
- in case an invalid policy is specifiedpublic static int deserializationPolicyFromStr(String policyStr)
IllegalArgumentException
- in case an invalid policy string is
specified
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |