jremote jbase5.2.1

com.jbase.jremote.io
Class NIOJBaseObjectReader

java.lang.Object
  extended by com.jbase.jremote.io.AbstractJBaseObjectReader
      extended by com.jbase.jremote.io.NIOJBaseObjectReader
All Implemented Interfaces:
JBaseObjectReader

public class NIOJBaseObjectReader
extends AbstractJBaseObjectReader

jBase object reader based on the new Java IO.

Author:
aphethean

Field Summary
static long READ_TIMEOUT
          The temporary selectors read timeout.
 
Fields inherited from class com.jbase.jremote.io.AbstractJBaseObjectReader
log
 
Constructor Summary
NIOJBaseObjectReader(ObjectFactory factory, SocketChannel channel)
           
 
Method Summary
protected  void checkBuffer(int newDataLength)
           
 void close()
           
protected  int doRead(int numberOfBytes)
          Read bytes using the read a temporary Selector
protected  byte getByte()
           
protected  int getBytes(byte[] buf)
           
protected  int getBytes(ByteBuffer bBuf)
           
protected  int getInt()
           
 ObjectFactory getObjectFactory()
          This method must be implemented by concrete ObjectReaders.
protected  int inBytes(int numberOfBytesToRead)
           
 boolean isClosed()
           
protected  String readUTF()
           
 void setSocketChannel(SocketChannel socketChannel)
           
 
Methods inherited from class com.jbase.jremote.io.AbstractJBaseObjectReader
bufferedRead, checkBuffer, readByteObject, readBytes, readInt, readJBaseSerializableObject, readObject, readObject, readObject, readRootObject, readString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_TIMEOUT

public static final long READ_TIMEOUT
The temporary selectors read timeout. 30 seconds.

See Also:
Constant Field Values
Constructor Detail

NIOJBaseObjectReader

public NIOJBaseObjectReader(ObjectFactory factory,
                            SocketChannel channel)
Method Detail

getObjectFactory

public ObjectFactory getObjectFactory()
Description copied from class: AbstractJBaseObjectReader
This method must be implemented by concrete ObjectReaders.

Specified by:
getObjectFactory in class AbstractJBaseObjectReader
Returns:
an instance of a class implementing JBaseSerializable

close

public void close()
           throws IOException
Specified by:
close in interface JBaseObjectReader
Specified by:
close in class AbstractJBaseObjectReader
Throws:
IOException

getByte

protected byte getByte()
                throws IOException
Specified by:
getByte in class AbstractJBaseObjectReader
Throws:
IOException

getInt

protected int getInt()
              throws IOException
Specified by:
getInt in class AbstractJBaseObjectReader
Throws:
IOException

getBytes

protected int getBytes(byte[] buf)
                throws IOException
Specified by:
getBytes in class AbstractJBaseObjectReader
Throws:
IOException

getBytes

protected int getBytes(ByteBuffer bBuf)
                throws IOException
Specified by:
getBytes in class AbstractJBaseObjectReader
Throws:
IOException

inBytes

protected int inBytes(int numberOfBytesToRead)
               throws IOException
Specified by:
inBytes in class AbstractJBaseObjectReader
Throws:
IOException

readUTF

protected String readUTF()
                  throws IOException
Specified by:
readUTF in class AbstractJBaseObjectReader
Throws:
IOException

doRead

protected int doRead(int numberOfBytes)
              throws IOException
Read bytes using the read a temporary Selector

Throws:
IOException

checkBuffer

protected void checkBuffer(int newDataLength)

isClosed

public boolean isClosed()

setSocketChannel

public void setSocketChannel(SocketChannel socketChannel)

jremote jbase5.2.1

Copyright © 2016 TEMENOS. All Rights Reserved.