SegmentedMemBuffer { public void truncate(long length) { if ( TRACKING ) log("truncate(%d)", length); if ( length < 0 ) IO.exception(String.format("truncate: bad length : %d", length)); checkOpen(); dataLength = Math.min(dataLength, length); } SegmentedMemBuffer();  SegmentedMemBuffer(int chunk); void open(); boolean isOpen(); int read(long posn, ByteBuffer bb); int read(long posn, byte[] b); int read(long posn, byte[] b, int start, int length); void write(long posn, ByteBuffer bb ); void write(long posn, byte[] b ); void write(long posn, byte[] b, int start, int length); void truncate(long length); void sync(); void close(); long length();  }
@Test public void membuffer_03() { SegmentedMemBuffer space = new SegmentedMemBuffer(); writeread1(space); space.truncate(0); writeread2(space); }
@Test public void membuffer_13() { SegmentedMemBuffer space = new SegmentedMemBuffer(2); writeread1(space); space.truncate(0); writeread2(space); }
@Test public void membuffer_23() { SegmentedMemBuffer space = new SegmentedMemBuffer(); writeread1(space); space.truncate(0); writeread2a(space); }
@Test public void membuffer_33() { SegmentedMemBuffer space = new SegmentedMemBuffer(2); writeread1a(space); space.truncate(0); writeread2a(space); }