public static void main( String args[] ){

    byte buf[] = new byte[ MiniDB_Constants.BLOCK_SIZE];
    int blockID = 1;

    MiniDB_Block blk = new MiniDB_Block(buf, blockID, null);
    
    blk.set((byte)'x');

    blk.writeLong(8,-1);
    blk.writeLong(24,-2);
    blk.writeLong(64,1);
    blk.writeLong(96,2);
    System.out.println( blk.toString() );
    System.out.println( "" + blk.readLong(8) + ", "  +  blk.readLong(24) );
    System.out.println( "" + blk.readLong(64) + ", "  +  blk.readLong(96) );
    System.exit(0);

    boolean testShort = false, testInt = false, testString = true;

    byte bs[] = {'H', 'I', 0, 0, 0};
    String sbs = new String( bs );
    //System.out.println( "String is " + sbs + ", length is " + sbs.length() );
    
    if( testShort ){
      short s1 = (short)1;
      short s2 = (short)99;
      short s3 = (short)7002;

      blk.writeShort(0, s1);
      blk.writeShort(10, s2);
      blk.writeShort(200, s3);

      System.out.println( blk.toString() );
      
      short sOut1 = blk.readShort(0) ;
      short sOut2 = blk.readShort(10) ;
      short sOut3 = blk.readShort(200) ;
      
      System.out.println( "" + sOut1 + " " + sOut2 + " " + sOut3 );
      
      assert( sOut1 == s1 );
      assert( sOut2 == s2 );
      assert( sOut3 == s3 );
    }
    else if(testInt){
      System.out.println( "testing read/write int" );
      int values[] = {0xa, 0xab, 0xFEDC, 0x1234, 0xFEDCBA98};
      int locations[] = {0,10, 15, 32, 36, 40, 44};

      for (int i=0; i<values.length; i++){
	blk.writeInt(locations[i], values[i]);	  
      }

      System.out.println( blk.toString() );

      for (int i=0; i<values.length; i++){
	int v = blk.readInt(locations[i]);
	System.out.println( "" + v + ", " + values[i] );
	assert( v == values[i] );
      }

    }
    else if(testString){
      System.out.println( "testing read/write String" );
      String values[] = {"Hello!", "These are the times"};
      int locations[] = {0,16};

      for (int i=0; i<values.length; i++){
	blk.writeString(locations[i], values[i]);	  
      }

      System.out.println( blk.toString() );

      for (int i=0; i<values.length; i++){
	String s = blk.readString(locations[i]);
	System.out.println( "" + s + ", " + values[i] );
	assert( s.equals(values[i]) );
      }
      
    }

  }