|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.io.IOHelper
public final class IOHelper
Collection of utility methods to create and manipulate IO objects.
| Method Summary | |
|---|---|
static DataLocation |
createDataLocationMemorySensitive(int size)
Create a data location object based on a comparison of the available heap memory and the data location object size. |
static File |
createTempFile(int size)
Create a temporary file. |
static boolean |
fitsInMemory(int size)
Determines whether the data of the specified size would fit in memory. |
static DataLocation |
readData(InputSource source)
Read a provider or task data from an input source. |
static void |
sendData(SocketWrapper socketWrapper,
Object o,
ObjectSerializer ser)
Serialize an object and send it to the server. |
static DataLocation |
serializeData(Object o,
ObjectSerializer ser)
Serialize an object and send it to the server. |
static DataLocation |
serializeDataToFile(Object o,
ObjectSerializer ser)
Serialize an object and send it to the server. |
static DataLocation |
serializeDataToMemory(Object o,
ObjectSerializer ser)
Serialize an object to a bugffer in memory. |
static InputStream |
unwrapData(JPPFDataTransform transform,
DataLocation source)
Apply a JPPFDataTransform to the specified source and store the results in memory. |
static InputStream |
unwrapDataToFile(JPPFDataTransform transform,
DataLocation source)
Apply a JPPFDataTransform to the specified source and store the results in a temporary file. |
static Object |
unwrappedData(DataLocation dl,
ObjectSerializer ser)
Deserialize the specified data into an object. |
static Object |
unwrappedData(SocketWrapper socketWrapper,
ObjectSerializer ser)
Deserialize the next object available via a network connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static DataLocation createDataLocationMemorySensitive(int size)
throws Exception
size - the requested size of the data location to create.
DataLocation object whose content may be stored in memory
or on another medium, depending on the available memory.
Exception - if an IO error occurs.
public static DataLocation readData(InputSource source)
throws Exception
source - the input source from which to read the data.
Exception - if an error occurs while deserializing.
public static File createTempFile(int size)
throws Exception
size - the file size (for logging purposes only).
File.
Exception - if an IO error occurs.public static boolean fitsInMemory(int size)
size - the data size to check.
public static Object unwrappedData(SocketWrapper socketWrapper,
ObjectSerializer ser)
throws Exception
socketWrapper - the network connection used to read data.ser - the object serializer to use.
Exception - if an error occurs while preparing the data.
public static Object unwrappedData(DataLocation dl,
ObjectSerializer ser)
throws Exception
dl - the data, stored in a memory-aware location.ser - the object serializer to use.
Exception - if an error occurs while preparing the data.
public static InputStream unwrapData(JPPFDataTransform transform,
DataLocation source)
throws Exception
JPPFDataTransform to the specified source and store the results in memory.
transform - the JPPFDataTransform to apply.source - the source data to transform.
InputStream.
Exception - if an error occurs while preparing the data.
public static InputStream unwrapDataToFile(JPPFDataTransform transform,
DataLocation source)
throws Exception
JPPFDataTransform to the specified source and store the results in a temporary file.
transform - the JPPFDataTransform to apply.source - the source data to transform.
File.
Exception - if an error occurs while preparing the data.
public static void sendData(SocketWrapper socketWrapper,
Object o,
ObjectSerializer ser)
throws Exception
socketWrapper - the socket client used to send data to the server.o - the object to serialize.ser - the object serializer.
Exception - if any error occurs.
public static DataLocation serializeData(Object o,
ObjectSerializer ser)
throws Exception
o - the object to serialize.ser - the object serializer.
DataLocation instance.
Exception - if any error occurs.
public static DataLocation serializeDataToMemory(Object o,
ObjectSerializer ser)
throws Exception
o - the object to serialize.ser - the object serializer.
MultipleBuffersOutputStream.
Exception - if any error occurs.
public static DataLocation serializeDataToFile(Object o,
ObjectSerializer ser)
throws Exception
o - the object to serialize.ser - the object serializer.
FileDataLocation.
Exception - if any error occurs.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||