You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2019/05/31 23:56:43 UTC

[incubator-tuweni] 01/03: Use ByteBuffer as backend for mutable bytes

This is an automated email from the ASF dual-hosted git repository.

toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git

commit 40369900baa7428769f3e1998b54aa26448e73eb
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Fri May 31 16:52:48 2019 -0700

    Use ByteBuffer as backend for mutable bytes
---
 bytes/src/main/java/org/apache/tuweni/bytes/MutableBytes.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bytes/src/main/java/org/apache/tuweni/bytes/MutableBytes.java b/bytes/src/main/java/org/apache/tuweni/bytes/MutableBytes.java
index e2363c6..0c33216 100644
--- a/bytes/src/main/java/org/apache/tuweni/bytes/MutableBytes.java
+++ b/bytes/src/main/java/org/apache/tuweni/bytes/MutableBytes.java
@@ -42,7 +42,7 @@ public interface MutableBytes extends Bytes {
     if (size == 32) {
       return MutableBytes32.create();
     }
-    return new MutableArrayWrappingBytes(new byte[size]);
+    return new MutableByteBufferWrappingBytes(ByteBuffer.allocate(size));
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org