2004-11-17 Michael Koch <konqueror@gmx.de>
* java/nio/DirectByteBufferImpl.java (owner): Updated comment. (allocate): New method. From-SVN: r90804
This commit is contained in:
parent
39850c0b2e
commit
4dbbd945e0
2 changed files with 15 additions and 1 deletions
|
@ -52,7 +52,7 @@ final class DirectByteBufferImpl extends ByteBuffer
|
|||
}
|
||||
}
|
||||
|
||||
/** Used by MappedByteBufferImpl to prevent premature GC. */
|
||||
/** Used by MappedByteBufferImpl and when slicing to prevent premature GC. */
|
||||
protected Object owner;
|
||||
|
||||
RawData address;
|
||||
|
@ -73,6 +73,14 @@ final class DirectByteBufferImpl extends ByteBuffer
|
|||
this.owner = owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates a new direct byte buffer.
|
||||
*/
|
||||
public static ByteBuffer allocate(int capacity)
|
||||
{
|
||||
return new DirectByteBufferImpl(allocateImpl(capacity), capacity);
|
||||
}
|
||||
|
||||
private static native RawData allocateImpl (int capacity);
|
||||
private static native void freeImpl (RawData address);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue