001    package edu.harvard.deas.hyperenc;
002    
003    import java.io.Serializable;
004    
005    /** A source of random bits.*/
006    public interface RandomSource extends Serializable
007    {
008      /**
009       * Fills <code>page</code> with random bytes. <code>block</code> may be used
010       * as a parameter that influences the creation of a page. Depending on
011       * implementation, calling <code>getPage</code> multiple times with the same
012       * <code>block</code> may not necessarily return the same page each time.
013       * 
014       * @param block
015       *        A buffer of random bytes used to create page.
016       * @param page
017       *        Created page. This array will be mutated to contain the created
018       *        page.
019       */
020      public void getPage(byte [] block, byte [] page) throws PageException;
021    }