|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.server.protocol.AbstractLocation<byte[]>
org.jppf.server.protocol.MemoryLocation
public class MemoryLocation
Wrapper fro manipulating a file.
| Field Summary |
|---|
| Fields inherited from class org.jppf.server.protocol.AbstractLocation |
|---|
eventsEnabled, listeners, path |
| Constructor Summary | |
|---|---|
MemoryLocation(byte[] buffer)
Initialize this location with the specified buffer. |
|
MemoryLocation(byte[] buffer,
int offset,
int len)
Initialize this location with the specified byte array. |
|
MemoryLocation(int size)
Initialize this location and create a buffer of the specified size. |
|
| Method Summary | |
|---|---|
InputStream |
getInputStream()
Obtain an input stream to read from this location. |
OutputStream |
getOutputStream()
Obtain an output stream to write to this location. |
long |
size()
Get the size of the file this location points to. |
byte[] |
toByteArray()
Get the content at this location as an array of bytes. |
| Methods inherited from class org.jppf.server.protocol.AbstractLocation |
|---|
addLocationEventListener, copyTo, fireLocationEvent, getPath, removeLocationEventListener, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MemoryLocation(int size)
size - the size of the buffer handled by this memory location.public MemoryLocation(byte[] buffer)
buffer - an array of bytes.
public MemoryLocation(byte[] buffer,
int offset,
int len)
buffer - an array of bytes.offset - the start position in the array of bytes.len - the length of the buffer.| Method Detail |
|---|
public InputStream getInputStream()
throws Exception
InputStream instance.
Exception - if an I/O error occurs.Location.getInputStream()
public OutputStream getOutputStream()
throws Exception
OutputStream instance.
Exception - if an I/O error occurs.Location.getOutputStream()public long size()
Location.size()
public byte[] toByteArray()
throws Exception
AbstractLocation.toByteArray() for improved performance.
toByteArray in interface Location<byte[]>toByteArray in class AbstractLocation<byte[]>Exception - if an I/O error occurs.AbstractLocation.toByteArray()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||