Bug 1538

Summary: Buffer class should specify the maximum index rather than highWater
Product: frysk Reporter: Jeff Johnston <jjohnstn>
Component: generalAssignee: Unassigned <frysk-bugzilla>
Severity: normal    
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 2127, 2231, 3119    

Description Jeff Johnston 2005-10-24 21:40:38 UTC
Currently, the highWater mark used in the inua.eio.Buffer class represents one
past the maximum accessible value.  For example, capacity is highWater -
lowWater.  When we are getting bytes and want to check that we are ok, we read
while we are less than bound (highWater).

If we are mapping memory to the ByteBuffer class, then we want the high water
mark to represent the top location we can reference because on a 64-bit address
system such as AMD64, max addr + 1 ends up being 0 as we roll over 64-bits.

In the aforementioned getting bytes from ByteBuffer, we want to continue while
the offset is less than equal to bound.  Thus, we can specify 0xffffffffffffffff
l for the max.
Comment 1 Zhao Shujing 2007-11-22 08:56:32 UTC
Add a test  testMemoryBufferCapacity() for it. The highWater is always be
0xffffffffffffffffL at 64-bit.
2007-11-22  Zhao Shujing  <pearly.zhao@oracle.com>

        * TestByteBuffer.java(testMemoryBufferCapacity()): New test.