|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.nio.JMemory
org.jnetpcap.nio.JStruct
public class JStruct
Base class for peered pure structure classes. This class purposely does not
extend JBuffer to allow structure fields to be read out generically as that
is not portable accross platforms and architectures. Most structures are
written specifically for local machine architecture and OS, unlike network
protocols which can be usually read by use of generic JBuffer.
Therefore as a general requirement each JStruct has to implement its own
native methods to read and write fields into the structure.
As a convention, each subclass of JStruct implements a static method
sizeof() which returns the length of the structure, if the
structure is static in length. If not, then no requirement to implement the
static method sizeof() exists.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory |
|---|
JMemory.Type |
| Field Summary |
|---|
| Fields inherited from class org.jnetpcap.nio.JMemory |
|---|
JNETPCAP_LIBRARY_NAME, MAX_DIRECT_MEMORY_DEFAULT, POINTER |
| Constructor Summary | |
|---|---|
JStruct(java.lang.String structName,
java.nio.ByteBuffer peer)
Creates a new structure object peered with the supplied object. |
|
JStruct(java.lang.String structName,
int size)
Creates a new structure object of specified size. |
|
JStruct(java.lang.String structName,
JMemory.Type type)
Creates a new structure object. |
|
JStruct(java.lang.String structName,
JMemory peer)
Creates a new structure object. |
|
| Method Summary | |
|---|---|
java.lang.String |
getStructName()
Gets the name of the native structure |
java.lang.String |
toString()
Debug information. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JStruct(java.lang.String structName,
JMemory.Type type)
structName - name of the native structuretype - memory model
public JStruct(java.lang.String structName,
java.nio.ByteBuffer peer)
structName - name of the native structurepeer - buffer to peer with
public JStruct(java.lang.String structName,
int size)
structName - name of the native structuresize - size in bytes for this new structure object
public JStruct(java.lang.String structName,
JMemory peer)
structName - name of the native structurepeer - memory to peer with| Method Detail |
|---|
public final java.lang.String getStructName()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||