From ddad54db7b38b9b919ef59dc988c1b2194fa184c Mon Sep 17 00:00:00 2001 From: Tobias Holgers Date: Tue, 30 Jun 2009 17:27:55 +0000 Subject: Always clone single byte array properties as some implementations reuse the array for cursors (e.g. BDB-C 4.6). --- src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/raw/KeyDecoder.java') diff --git a/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java b/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java index a14a1a3..01fb627 100644 --- a/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java +++ b/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java @@ -830,7 +830,7 @@ public class KeyDecoder { /** * Decodes the given byte array which was encoded by {@link - * KeyEncoder#encodeSingleDesc}. + * KeyEncoder#encodeSingleDesc}. Always returns a new byte array instance. */ public static byte[] decodeSingleDesc(byte[] src) throws CorruptEncodingException { return decodeSingleDesc(src, 0, 0); @@ -838,7 +838,7 @@ public class KeyDecoder { /** * Decodes the given byte array which was encoded by {@link - * KeyEncoder#encodeSingleDesc}. + * KeyEncoder#encodeSingleDesc}. Always returns a new byte array instance. * * @param prefixPadding amount of extra bytes to skip from start of encoded byte array * @param suffixPadding amount of extra bytes to skip at end of encoded byte array @@ -863,7 +863,8 @@ public class KeyDecoder { /** * Decodes the given byte array which was encoded by {@link - * KeyEncoder#encodeSingleNullableDesc}. + * KeyEncoder#encodeSingleNullableDesc}. Always returns a new byte array + * instance. */ public static byte[] decodeSingleNullableDesc(byte[] src) throws CorruptEncodingException { return decodeSingleNullableDesc(src, 0, 0); @@ -871,7 +872,8 @@ public class KeyDecoder { /** * Decodes the given byte array which was encoded by {@link - * KeyEncoder#encodeSingleNullableDesc}. + * KeyEncoder#encodeSingleNullableDesc}. Always returns a new byte array + * instance. * * @param prefixPadding amount of extra bytes to skip from start of encoded byte array * @param suffixPadding amount of extra bytes to skip at end of encoded byte array -- cgit v1.2.3