|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simpleframework.util.buffer.FileAllocator
public class FileAllocator
The FileAllocator object is used to create buffers
that can be written to the file system. This creates buffers as
files if they are larger than the specified limit. This ensures
that buffers of arbitrary large size can be created. All buffer
sizes under the limit are created using byte arrays allocated
on the executing VM heap. This ensures that optimal performance
is maintained for buffers of reasonable size.
| Constructor Summary | |
|---|---|
FileAllocator()
Constructor for the FileAllocator object. |
|
FileAllocator(int limit)
Constructor for the FileAllocator object. |
|
FileAllocator(String prefix)
Constructor for the FileAllocator object. |
|
FileAllocator(String prefix,
int limit)
Constructor for the FileAllocator object. |
|
| Method Summary | |
|---|---|
Buffer |
allocate()
This will allocate a file buffer which will write data for the buffer to a file. |
Buffer |
allocate(long size)
This will allocate a file buffer which will write data for the buffer to a file. |
void |
close()
This method is used to close the allocator so that resources that are occupied by the allocator can be freed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileAllocator()
FileAllocator object. This is
used to create buffers in memory up to a threshold size. If a
buffer is required over the threshold size then the data is
written to a file, where it can be retrieved at a later point.
public FileAllocator(int limit)
FileAllocator object. This is
used to create buffers in memory up to a threshold size. If a
buffer is required over the threshold size then the data is
written to a file, where it can be retrieved at a later point.
limit - this is the maximum size for a heap bufferpublic FileAllocator(String prefix)
FileAllocator object. This is
used to create buffers in memory up to a threshold size. If a
buffer is required over the threshold size then the data is
written to a file, where it can be retrieved at a later point.
prefix - this is the file prefix for the file buffers
public FileAllocator(String prefix,
int limit)
FileAllocator object. This is
used to create buffers in memory up to a threshold size. If a
buffer is required over the threshold size then the data is
written to a file, where it can be retrieved at a later point.
prefix - this is the file prefix for the file bufferslimit - this is the maximum size for a heap buffer| Method Detail |
|---|
public Buffer allocate()
throws IOException
allocate in interface AllocatorIOException
public Buffer allocate(long size)
throws IOException
allocate in interface Allocatorsize - this is the size of the buffer to be created
IOException
public void close()
throws IOException
close in interface Closeableclose in interface AllocatorIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||