Bug 1538 - Buffer class should specify the maximum index rather than highWater
Summary: Buffer class should specify the maximum index rather than highWater
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Unassigned
Depends on:
Blocks: 2127 2231 3119
  Show dependency treegraph
Reported: 2005-10-24 21:40 UTC by Jeff Johnston
Modified: 2007-11-22 08:56 UTC (History)
0 users

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
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.