lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: Helper method for sbyte[]->byte[] conversion
Date Mon, 10 Nov 2014 15:30:03 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master ee575336c -> 4f1399f4b


Helper method for sbyte[]->byte[] conversion


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/4f1399f4
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/4f1399f4
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/4f1399f4

Branch: refs/heads/master
Commit: 4f1399f4b336fd08af84058198ee710cfa9153f1
Parents: ee57533
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Mon Nov 10 17:30:00 2014 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Mon Nov 10 17:30:00 2014 +0200

----------------------------------------------------------------------
 src/Lucene.Net.TestFramework/Util/TestUtil.cs | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4f1399f4/src/Lucene.Net.TestFramework/Util/TestUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/TestUtil.cs b/src/Lucene.Net.TestFramework/Util/TestUtil.cs
index 2fa35f1..d76e0c3 100644
--- a/src/Lucene.Net.TestFramework/Util/TestUtil.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestUtil.cs
@@ -1432,5 +1432,12 @@ namespace Lucene.Net.Util
             '\u0009', '\n', '\u000B', '\u000C', '\r', '\u001C', '\u001D', '\u001E', '\u001F',
'\u0020', '\u1680', '\u180E', '\u2000',
             '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', '\u2008', '\u2009',
'\u200A', '\u2028', '\u2029', '\u205F', '\u3000'
         };
+
+        public static byte[] ToByteArray(this sbyte[] arr)
+        {
+            var unsigned = new byte[arr.Length];
+            System.Buffer.BlockCopy(arr, 0, unsigned, 0, arr.Length);
+            return unsigned;
+        }
     }
 }
\ No newline at end of file


Mime
View raw message