org.jsesoft.jse
Interface GenericInterface

All Known Implementing Classes:
CallbackData, CloseConnectionRequestData, CloseConnectionResponseData, CloseSessionRequestData, CloseSessionResponseData, CloseStreamRequestData, CloseStreamResponseData, ControlData, GenericData, InformationResponseData, OpenConnectionRequestData, OpenConnectionResponseData, OpenSessionRequestData, OpenSessionResponseData, OpenStreamRequestData, OpenStreamResponseData, ProcessConnectionRequestData, ProcessConnectionResponseData, SendMessageRequestData, SendMessageResponseData, StatusData

public interface GenericInterface

Generic interface for byte buffer / void conversion

Description:

Copyright: (c) 2002 JSESoft

Company: JSESoft

Version:
$Revision: 1.3 $
Author:
JSESoft

Method Summary
 void fromBytes()
          Converts local variables from the local byte buffer.
 void fromBytes(java.nio.ByteBuffer buffer)
          Converts local variables from the specified byte buffer.
 void fromBytes(java.nio.ByteBuffer buffer, boolean refresh)
          Converts local variables from the specified byte buffer.
 void setBuffer(java.nio.ByteBuffer buffer)
          Set the local byte buffer.
 void setBuffer(java.nio.ByteBuffer buffer, boolean refresh)
          Set the local byte buffer.
 java.nio.ByteBuffer toBytes()
          Converts local variables to (direct) byte buffer.
 java.nio.ByteBuffer toBytes(boolean direct)
          Converts local variables to byte buffer.
 

Method Detail

fromBytes

public void fromBytes()
Converts local variables from the local byte buffer.

See Also:
toBytes()

fromBytes

public void fromBytes(java.nio.ByteBuffer buffer)
Converts local variables from the specified byte buffer.
The local byte buffer is refreshed.

Parameters:
buffer - the byte buffer containing all values
See Also:
toBytes()

fromBytes

public void fromBytes(java.nio.ByteBuffer buffer,
                      boolean refresh)
Converts local variables from the specified byte buffer.
If refresh is false, this does not affect the local byte buffer (until the next call of toBytes()).

Parameters:
buffer - the byte buffer containing all values
refresh - whether to refresh to local byte buffer
See Also:
toBytes()

setBuffer

public void setBuffer(java.nio.ByteBuffer buffer)
Set the local byte buffer.
If set to null, a byte buffer will be created on demand. The local variables are refreshed.

See Also:
fromBytes()

setBuffer

public void setBuffer(java.nio.ByteBuffer buffer,
                      boolean refresh)
Set the local byte buffer.
If set to null, a byte buffer will be created on demand. If refresh is false, the local variables are not affected (until the next call of fromBytes()).

Parameters:
refresh - whether to refresh the local variables
See Also:
fromBytes()

toBytes

public java.nio.ByteBuffer toBytes()
Converts local variables to (direct) byte buffer.
This function converts all members to a byte buffer.

Returns:
the byte buffer

toBytes

public java.nio.ByteBuffer toBytes(boolean direct)
Converts local variables to byte buffer.
This function converts all members to a byte buffer. The byte buffer is created, if necessary. It is created as direct, if specified.

Parameters:
direct - whether buffer should be created direct
Returns:
the byte buffer