From: mkoch Date: Wed, 13 Nov 2002 18:43:20 +0000 (+0000) Subject: 2002-11-13 Michael Koch X-Git-Tag: upstream/4.9.2~83445 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1ee509f09f6a80ff9f75366de4bb3a7e7701914;p=platform%2Fupstream%2Flinaro-gcc.git 2002-11-13 Michael Koch * java/nio/ByteBuffer.java (allocate): New method. (wrap): New method. (put): New method. (get): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59082 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 034d8ae..039a9d4 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,13 @@ 2002-11-13 Michael Koch + * java/nio/ByteBuffer.java + (allocate): New method. + (wrap): New method. + (put): New method. + (get): New method. + +2002-11-13 Michael Koch + * java/nio/channels/AlreadyConnectedException.java: Removed unneeded import. (AlreadyConnectedException): Documentation added. diff --git a/libjava/java/nio/ByteBuffer.java b/libjava/java/nio/ByteBuffer.java index 4b02f7f..874943a 100644 --- a/libjava/java/nio/ByteBuffer.java +++ b/libjava/java/nio/ByteBuffer.java @@ -39,4 +39,41 @@ package java.nio; public abstract class ByteBuffer extends Buffer { + public static ByteBuffer allocate (int capacity) + { + return null; + } + + final public static ByteBuffer wrap (byte[] array, int offset, int length) + { + return null; + } + + final public static ByteBuffer wrap (byte[] array) + { + return wrap (array, 0, array.length); + } + + final public ByteBuffer put (ByteBuffer src) + { + while (src.hasRemaining ()) + put (src.get ()); + + return this; + } + + final public ByteBuffer put (byte[] src, int offset, int length) + { + for (int i = offset; i < offset + length; i++) + put (src [i]); + return this; + } + public final ByteBuffer put (byte[] src) + { + return put (src, 0, src.length); + } + + public abstract byte get (); + + public abstract ByteBuffer put (byte b); }