@Test
  public void testBaseBuffers() throws IOException {
    NonSyncDataOutputBuffer dob = new NonSyncDataOutputBuffer();
    final Random r = new Random();
    final long seed = 0x0123456789ABCDEFL; // hardcoded for reproducibility.
    r.setSeed(seed);
    System.out.println("SEED: " + seed);
    
    writeJunk(dob, r, seed, 1000);
    NonSyncDataInputBuffer dib = new NonSyncDataInputBuffer();
    dib.reset(dob.getData(), 0, dob.getLength());
    assertEquals(0, dib.getPosition());
    assertEquals(dob.getLength(), dib.getLength());
    readJunk(dib, r, seed, 1000);

    dob.reset();
    writeJunk(dob, r, seed, 1000);
    dib.reset(dob.getData(), dob.getLength());
    assertEquals(0, dib.getPosition());
    assertEquals(dob.getLength(), dib.getLength());
    readJunk(dib, r, seed, 1000);
  }
Tests methods of {@link NonSyncDataInputBuffer}.
@throws IOException
ql/src/test/org/apache/hadoop/hive/ql/io/TestHiveInputOutputBuffer.java