|
|||||||||
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(java.lang.String prefix)
Constructor for the FileAllocator object. |
|
FileAllocator(java.lang.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(int 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() throws java.io.IOException
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.
java.io.IOException
public FileAllocator(int limit) throws java.io.IOException
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 buffer
java.io.IOException
public FileAllocator(java.lang.String prefix) throws java.io.IOException
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
java.io.IOException
public FileAllocator(java.lang.String prefix, int limit) throws java.io.IOException
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
java.io.IOException
Method Detail |
---|
public Buffer allocate() throws java.io.IOException
allocate
in interface Allocator
java.io.IOException
public Buffer allocate(int size) throws java.io.IOException
allocate
in interface Allocator
size
- this is the size of the buffer to be created
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface Allocator
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |