Packages

 

com.aspose.cad

Class Cache



  • public class Cache
    extends Object

    Contains cache settings.

    • Field Detail

      • Reallocated

        public static final com.aspose.ms.lang.Event<com.aspose.ms.System.EventHandler> Reallocated
    • Constructor Detail

      • Cache

        public Cache()
    • Method Detail

      • getExactReallocateOnly

        public static boolean getExactReallocateOnly()

        Gets or sets a value indicating whether reallocation should be exact or not. If reallocation is non exact the performance should be higher.

        Value: true if reallocation is exact; otherwise, false.

        The exact reallocation will perform reallocation of additional memory only up to the upper limit specified. When passing upper limit for in-memory during reallocation the cached data will be copied to disk if possible. When passing upper limit for disk memory during reallocation the appropriate exception is thrown. The performance should be higher if this option is turned off as no additional copying will be performed if possible, however this may also lead to pass upper limits specified for memory or disk.

      • setExactReallocateOnly

        public static void setExactReallocateOnly(boolean value)

        Gets or sets a value indicating whether reallocation should be exact or not. If reallocation is non exact the performance should be higher.

        Value: true if reallocation is exact; otherwise, false.

        The exact reallocation will perform reallocation of additional memory only up to the upper limit specified. When passing upper limit for in-memory during reallocation the cached data will be copied to disk if possible. When passing upper limit for disk memory during reallocation the appropriate exception is thrown. The performance should be higher if this option is turned off as no additional copying will be performed if possible, however this may also lead to pass upper limits specified for memory or disk.

      • getCacheFolder

        public static String getCacheFolder()

        Gets or sets the cache folder.

        Value: The cache folder.
      • setCacheFolder

        public static void setCacheFolder(String value)

        Gets or sets the cache folder.

        Value: The cache folder.
      • getAllocatedMemoryBytesCount

        public static long getAllocatedMemoryBytesCount()

        Gets the allocated in-memory bytes count.

        Value: The allocated in-memory bytes count.
      • getAllocatedDiskBytesCount

        public static long getAllocatedDiskBytesCount()

        Gets the allocated disk bytes count.

        Value: The allocated disk bytes count.
      • getMaxMemoryForCache

        public static int getMaxMemoryForCache()

        Gets or sets the maximum available memory for cache in memory. The value specified is megabytes count.

        Value: The maximum memory for cache.

        Value of 0 will consume all available memory and serves as no upper limit.

      • setMaxMemoryForCache

        public static void setMaxMemoryForCache(int value)

        Gets or sets the maximum available memory for cache in memory. The value specified is megabytes count.

        Value: The maximum memory for cache.

        Value of 0 will consume all available memory and serves as no upper limit.

      • getMaxDiskSpaceForCache

        public static int getMaxDiskSpaceForCache()

        Gets or sets the maximum available disk space for cache. The value specified is megabytes count.

        Value: The maximum available disk space for cache.

        Value of 0 will consume all available memory and serves as no upper limit.

      • setMaxDiskSpaceForCache

        public static void setMaxDiskSpaceForCache(int value)

        Gets or sets the maximum available disk space for cache. The value specified is megabytes count.

        Value: The maximum available disk space for cache.

        Value of 0 will consume all available memory and serves as no upper limit.

      • getCacheType

        public static int getCacheType()

        Gets or sets the cache scheme used.

        Value: The cache scheme used.
      • setCacheType

        public static void setCacheType(int value)

        Gets or sets the cache scheme used.

        Value: The cache scheme used.
      • setDefaults

        public static void setDefaults()

        Sets the Cache settings to defaults.

      • allocate_internalized

        public static StreamContainer allocate_internalized(long length)

        Allocates a new stream container of the specified length.

        Parameters:
        length - The length, specified in bytes.
        Returns:
        The allocated stream or appropriate exception if allocation failed.
      • allocateOnDiskOnly

        public static com.aspose.ms.System.IO.Stream allocateOnDiskOnly(long length)

        Allocates the stream on disk only.

        Parameters:
        length - The desired stream length.
        Returns:
        The allocated stream.