Commit 4dbbd945 by Michael Koch Committed by Michael Koch

2004-11-17 Michael Koch <konqueror@gmx.de>

	*  java/nio/DirectByteBufferImpl.java
	(owner): Updated comment.
	(allocate): New method.

From-SVN: r90804
parent 39850c0b
2004-11-17 Michael Koch <konqueror@gmx.de> 2004-11-17 Michael Koch <konqueror@gmx.de>
* java/nio/DirectByteBufferImpl.java
(owner): Updated comment.
(allocate): New method.
2004-11-17 Michael Koch <konqueror@gmx.de>
* java/net/URL.java (URL): Handle case when argument is null. * java/net/URL.java (URL): Handle case when argument is null.
2004-11-17 Michael Koch <konqueror@gmx.de> 2004-11-17 Michael Koch <konqueror@gmx.de>
......
...@@ -52,7 +52,7 @@ final class DirectByteBufferImpl extends ByteBuffer ...@@ -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; protected Object owner;
RawData address; RawData address;
...@@ -73,6 +73,14 @@ final class DirectByteBufferImpl extends ByteBuffer ...@@ -73,6 +73,14 @@ final class DirectByteBufferImpl extends ByteBuffer
this.owner = owner; 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 RawData allocateImpl (int capacity);
private static native void freeImpl (RawData address); private static native void freeImpl (RawData address);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment