Package org.jppf.nio
Class PlainNioObject
java.lang.Object
org.jppf.nio.AbstractNioObject
org.jppf.nio.PlainNioObject
- All Implemented Interfaces:
NioObject
Instances of this class represent a data frame read asynchronously from an input source.
- Author:
- Laurent Cohen
-
Field Summary
Fields inherited from class org.jppf.nio.AbstractNioObject
channelCount, count, location, size -
Constructor Summary
ConstructorsConstructorDescriptionPlainNioObject(SocketChannel channel, int size) Initialize this NioObject with the specified channel and size.PlainNioObject(SocketChannel channel, DataLocation location) Initialize this NioObject with the specified size.PlainNioObject(SocketChannel channel, JPPFBuffer buf) Initialize this NioObject with the specified channel and size. -
Method Summary
Methods inherited from class org.jppf.nio.AbstractNioObject
getChannelCount, getData, getSize
-
Constructor Details
-
PlainNioObject
Initialize this NioObject with the specified channel and size.- Parameters:
channel- where to read or write the data.size- the size of the internal buffer.
-
PlainNioObject
Initialize this NioObject with the specified channel and size.- Parameters:
channel- where to read or write the data.buf- the internal buffer.
-
PlainNioObject
Initialize this NioObject with the specified size.- Parameters:
channel- where to read or write the data.location- the location of the data to read from or write to.
-
-
Method Details
-
read
Read the current block of data.- Returns:
trueif the data has been read fully,falseotherwise.- Throws:
Exception- if any error occurs.
-
write
Write the current data object.- Returns:
trueif the data has been written fully,falseotherwise.- Throws:
Exception- if any error occurs.
-
toString
-
reset
Description copied from interface:NioObjectReset this object.- Specified by:
resetin interfaceNioObject- Overrides:
resetin classAbstractNioObject- Returns:
- an Object of the same class.
-