net.i2p.crypto
Class SHA256EntryCache

java.lang.Object
  extended bynet.i2p.crypto.SHA256EntryCache

public final class SHA256EntryCache
extends java.lang.Object

Cache the objects used in SHA256Generator's calculate method to reduce memory churn. The CacheEntry should be held onto as long as the data referenced in it is needed (which often is only one or two lines of code)


Nested Class Summary
static class SHA256EntryCache.CacheEntry
          all the data alloc'ed in a calculateHash call
 
Constructor Summary
SHA256EntryCache()
           
 
Method Summary
 SHA256EntryCache.CacheEntry acquire(int payload)
          Get the next available structure, either from the cache or a brand new one
static void main(java.lang.String[] args)
           
 void release(SHA256EntryCache.CacheEntry entry)
          Put this structure back onto the available cache for reuse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHA256EntryCache

public SHA256EntryCache()
Method Detail

acquire

public final SHA256EntryCache.CacheEntry acquire(int payload)
Get the next available structure, either from the cache or a brand new one


release

public final void release(SHA256EntryCache.CacheEntry entry)
Put this structure back onto the available cache for reuse


main

public static void main(java.lang.String[] args)