de.jadv.lib.network
Class SyncByteBuffersForChannels
java.lang.Object
|
+--de.jadv.lib.network.SyncByteBuffersForChannels
- public class SyncByteBuffersForChannels
- extends java.lang.Object
Buffers to read/write through java.nio channels
The buffers are always in the position to write to them.
So if you want to read from them do
buffer.flip()
read-Action
buffer.compact()
buffer.position(buffer.limit())
buffer.limit(buffer.capazity())
- Author:
- neitzel
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inputBuffer
java.nio.ByteBuffer inputBuffer
outputBuffer
java.nio.ByteBuffer outputBuffer
sentBytes
long sentBytes
receivedBytes
long receivedBytes
SyncByteBuffersForChannels
public SyncByteBuffersForChannels()
- Constructor for SyncByteBuffersForChannels.
SyncByteBuffersForChannels
public SyncByteBuffersForChannels(int capacity)
SyncByteBuffersForChannels
public SyncByteBuffersForChannels(int capacityIn,
int capacityOut)
getReceivedBytes
public long getReceivedBytes()
getSentBytes
public long getSentBytes()
sendData
public int sendData(java.nio.channels.SocketChannel sChannel)
throws java.io.IOException
java.io.IOException
receiveData
public int receiveData(java.nio.channels.SocketChannel sChannel)
throws java.io.IOException
java.io.IOException
sendEvent
public void sendEvent(JAdvEvent event)
decodeEvent
public JAdvEvent decodeEvent()