Package org.jppf.io
Class AbstractDataLocation
java.lang.Object
org.jppf.io.AbstractDataLocation
- All Implemented Interfaces:
DataLocation
- Direct Known Subclasses:
FileDataLocation,MultipleBuffersLocation
Abstract implementation of the
DataLocation interface.>br>
This class provides default implementations for the transferFrom(ReadableByteChannel, boolean) and
transferTo(WritableByteChannel, boolean) methods.- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe capacity of the underlying buffer.protected booleanDetermines whether a transfer has been started.Fields inherited from interface org.jppf.io.DataLocation
UNKNOWN_SIZE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jppf.io.DataLocation
copy, getInputStream, getOutputStream, transferFrom, transferTo
-
Field Details
-
size
protected int sizeThe capacity of the underlying buffer. -
transferring
protected boolean transferringDetermines whether a transfer has been started.
-
-
Constructor Details
-
AbstractDataLocation
public AbstractDataLocation()
-
-
Method Details
-
getSize
public int getSize()Get the size of the data referenced by this data location.- Specified by:
getSizein interfaceDataLocation- Returns:
- the data size as an int.
-
setSize
public void setSize(int size) Set the size of the data referenced by this data location.- Parameters:
size- the data size as an int.
-