Lucene.Net.Core.Support (DataInputStream + IDataInput): Renamed ReadByte() > 
ReadSByte(), ReadUnsignedByte() > ReadByte() (.NET semantics)


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

Branch: refs/heads/api-work
Commit: d98c1a76a915012aed7cd046e051c7dfb3b103ef
Parents: 8e291a6
Author: Shad Storhaug <[email protected]>
Authored: Thu Mar 2 00:47:50 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Thu Mar 2 08:08:58 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Support/DataInputStream.cs | 14 ++++++++++----
 src/Lucene.Net.Core/Support/IDataInput.cs      | 10 +++++++++-
 2 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d98c1a76/src/Lucene.Net.Core/Support/DataInputStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/DataInputStream.cs 
b/src/Lucene.Net.Core/Support/DataInputStream.cs
index 71cd5b1..8265735 100644
--- a/src/Lucene.Net.Core/Support/DataInputStream.cs
+++ b/src/Lucene.Net.Core/Support/DataInputStream.cs
@@ -96,20 +96,26 @@ namespace Lucene.Net.Support
             return (ch != 0);
         }
 
-        public byte ReadByte() // LUCENENET TODO: Rename ReadSByte() ... 
change this to int the same as Stream.ReadByte() ? (since putting sbyte here is 
ugly)
+        /// <summary>
+        /// NOTE: This was readByte() in the JDK
+        /// </summary>
+        public int ReadSByte()
         {
             int ch = @in.ReadByte();
             if (ch < 0)
                 throw new EndOfStreamException();
-            return (byte)(ch);
+            return ch;
         }
 
-        public int ReadUnsignedByte() // LUCENET TODO: Rename ReadByte() after 
above method is fixed
+        /// <summary>
+        /// NOTE: This was readUnsignedByte() in the JDK
+        /// </summary>
+        public byte ReadByte()
         {
             int ch = @in.ReadByte();
             if (ch < 0)
                 throw new EndOfStreamException();
-            return ch;
+            return (byte)ch;
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d98c1a76/src/Lucene.Net.Core/Support/IDataInput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/IDataInput.cs 
b/src/Lucene.Net.Core/Support/IDataInput.cs
index c1c39fa..ad10b9c 100644
--- a/src/Lucene.Net.Core/Support/IDataInput.cs
+++ b/src/Lucene.Net.Core/Support/IDataInput.cs
@@ -9,8 +9,16 @@
         void ReadFully(byte[] b, int off, int len);
         int SkipBytes(int n);
         bool ReadBoolean();
+
+        /// <summary>
+        /// NOTE: This was readByte() in the JDK
+        /// </summary>
+        int ReadSByte();
+
+        /// <summary>
+        /// NOTE: This was readUnsignedByte() in the JDK
+        /// </summary>
         byte ReadByte();
-        int ReadUnsignedByte();
 
         /// <summary>
         /// NOTE: This was readShort() in the JDK

Reply via email to