ehcache

net.sf.ehcache.util
Class MemorySizeParser

java.lang.Object
  extended by net.sf.ehcache.util.MemorySizeParser

public class MemorySizeParser
extends Object

Memory size parser using the letter k or K to indicate kilobytes, the letter m or M to indicate megabytes, the letter g or G to indicate gigabytes and the letter t or T to indicate terabytes.

Author:
Ludovic Orban

Constructor Summary
MemorySizeParser()
           
 
Method Summary
static long parse(String configuredMemorySize)
          Parse a String containing a human-readable memory size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemorySizeParser

public MemorySizeParser()
Method Detail

parse

public static long parse(String configuredMemorySize)
                  throws IllegalArgumentException
Parse a String containing a human-readable memory size.

Parameters:
configuredMemorySize - the String containing a human-readable memory size.
Returns:
the memory size in bytes.
Throws:
IllegalArgumentException - thrown when the configured memory size cannot be parsed.

ehcache

Copyright 2001-2014, Terracotta, Inc.