You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/06/18 18:28:02 UTC

svn commit: r786151 - in /commons/sandbox/runtime/trunk/src: main/java/org/apache/commons/runtime/Memory.java test/org/apache/commons/runtime/TestMemory.java

Author: mturk
Date: Thu Jun 18 16:28:02 2009
New Revision: 786151

URL: http://svn.apache.org/viewvc?rev=786151&view=rev
Log:
toByteArray makes more sense

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Memory.java
    commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Memory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Memory.java?rev=786151&r1=786150&r2=786151&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Memory.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Memory.java Thu Jun 18 16:28:02 2009
@@ -365,7 +365,7 @@
      * @throws NullPointerException if {@code ptr} is {@code null}.
      * @throws OutOfMemoryError if memory cannot be dipicated.
      */
-    public static byte[] asByteArray(Pointer ptr, long offset, int length)
+    public static byte[] toByteArray(Pointer ptr, long offset, int length)
         throws IndexOutOfBoundsException, IllegalArgumentException,
                NullPointerException, OutOfMemoryError
     {

Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java?rev=786151&r1=786150&r2=786151&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java (original)
+++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java Thu Jun 18 16:28:02 2009
@@ -188,7 +188,7 @@
         Pointer p = Memory.calloc(1000);
         assertNotNull("Pointer", p);
         Memory.set(p, 0, 1000, 0xFF);
-        byte[] b = Memory.asByteArray(p, 0, 1000);
+        byte[] b = Memory.toByteArray(p, 0, 1000);
         assertNotNull("Array", b);
         assertEquals("Length", 1000, b.length);
         assertEquals("Value", (byte)0xFF, b[0]);