public RootBlockView(final boolean rootBlock0,final ByteBuffer buf,final ChecksumUtility checker) throws RootBlockException {
  if (buf == null)   throw new IllegalArgumentException();
  if (buf.remaining() != SIZEOF_ROOT_BLOCK) {
    throw new IllegalArgumentException("Expecting " + SIZEOF_ROOT_BLOCK + " remaining, actual="+ buf.remaining());
  }
  this.buf=buf.asReadOnlyBuffer();
  this.rootBlock0=rootBlock0;
switch (getStoreType()) {
case RW:
{
      am=new RWAddressManager(null);
      break;
    }
case WORM:
{
    final int offsetBits=getOffsetBits();
    am=new WormAddressManager(offsetBits);
    break;
  }
default :
throw new RootBlockException("Unknown storeType=" + getStoreType());
}
if (checker == null) {
log.warn("Checksum will not be validated");
}
this.checker=checker;
valid();
}

public RootBlockView ( final boolean rootBlock0 , final ByteBuffer buf , final ChecksumUtility checker ) throws RootBlockException { if ( buf == null ) throw new IllegalArgumentException ( ) ; if ( buf . remaining ( ) != SIZEOF_ROOT_BLOCK ) { throw new IllegalArgumentException ( "Expecting " + SIZEOF_ROOT_BLOCK + " remaining, actual=" + buf . remaining ( ) ) ; } this . buf = buf . asReadOnlyBuffer ( ) ; this . rootBlock0 = rootBlock0 ; switch ( getStoreType ( ) ) { case RW : { am = new RWAddressManager ( null ) ; break ; } case WORM : { final int offsetBits = getOffsetBits ( ) ; am = new WormAddressManager ( offsetBits ) ; break ; } default : throw new RootBlockException ( "Unknown storeType=" + getStoreType ( ) ) ; } if ( checker == null ) { log . warn ( "Checksum will not be validated" ) ; } this . checker = checker ; valid ( ) ; }
create a new read - only view from the supplied buffer .
