public class TemporaryStorage extends Object implements org.forgerock.util.Factory<Buffer>
Modifier and Type | Class and Description |
---|---|
static class |
TemporaryStorage.Heaplet
Creates and initializes a temporary storage object in a heap environment.
|
Modifier and Type | Field and Description |
---|---|
static int |
HEIGHT_KB
8 KiB.
|
static int |
ONE_MB
1 MiB.
|
static int |
SIXTY_FOUR_KB
64 KiB.
|
static String |
TEMPORARY_STORAGE_HEAP_KEY
Key to retrieve a
TemporaryStorage instance from the Heap . |
Constructor and Description |
---|
TemporaryStorage()
Builds a storage using the system dependent default temporary directory and default sizes.
|
TemporaryStorage(File directory)
Builds a storage using the given directory (may be null) and default sizes.
|
TemporaryStorage(File directory,
int initialLength,
int memoryLimit,
int fileLimit)
Builds a storage using the given directory (may be null) and provided sizes.
|
public static final String TEMPORARY_STORAGE_HEAP_KEY
TemporaryStorage
instance from the Heap
.public static final int HEIGHT_KB
public static final int SIXTY_FOUR_KB
public static final int ONE_MB
public TemporaryStorage()
new TemporaryStorage(null)
.TemporaryStorage(File)
public TemporaryStorage(File directory)
new TemporaryStorage(directory, HEIGHT_KB, SIXTY_FOUR_KB, ONE_MB)
.directory
- The directory where temporary files are created. If null
, then the system-dependent default
temporary directory will be used.TemporaryStorage(File, int, int, int)
public TemporaryStorage(File directory, int initialLength, int memoryLimit, int fileLimit)
directory
- The directory where temporary files are created. If null
, then the system-dependent default
temporary directory will be used.initialLength
- The initial length of memory buffer byte array.memoryLimit
- The length limit of the memory buffer. Attempts to exceed this limit will result in promoting the buffer
from a memory to a file buffer.fileLimit
- The length limit of the file buffer. Attempts to exceed this limit will result in an OverflowException
being thrown.TemporaryStorage(File, int, int, int)
public Buffer newInstance()
newInstance
in interface org.forgerock.util.Factory<Buffer>
Copyright © 2014 ForgeRock AS. All rights reserved.