JDK-6200448 : (bf) Can't allocate ByteBuffers over 2 GBytes
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-11-25
  • Updated: 2012-01-11
  • Resolved: 2004-11-29
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
J2SE 1.4 - 5.0

ADDITIONAL OS VERSION INFORMATION :
WindowsXP SP2

A DESCRIPTION OF THE PROBLEM :
The method java.nio.ByteBuffer.allocate() takes an int as its argument, not a long.  This limits the size of the byte buffer to 2 GBytes.  There should be a version of the allocate() method that takes a long for allocating large byte buffers.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I should be able to allocate large byte buffers.

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
EVALUATION All methods in the java.nio.*Buffer classes are limited to 32-bit addressing since allocation and all indicies into the buffers are expressed as integers. Duplicate of 4496703. ###@###.### 2004-11-29 23:07:50 GMT
29-11-2004