You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2022/11/22 10:48:21 UTC

[GitHub] [lucenenet] NightOwl888 commented on a diff in pull request #769: WIP: Align InputStreamDataInput and OutputStreamDataOutput closer to the Java Source

NightOwl888 commented on code in PR #769:
URL: https://github.com/apache/lucenenet/pull/769#discussion_r1029166739


##########
src/Lucene.Net/Store/InputStreamDataInput.cs:
##########
@@ -25,16 +25,16 @@ namespace Lucene.Net.Store
     /// </summary>
     public class InputStreamDataInput : DataInput, IDisposable
     {
-        private BinaryReader _reader;
+        private readonly Stream _is;
 
         public InputStreamDataInput(Stream @is)
         {
-            this._reader = new BinaryReader(@is);
+            this._is = @is ?? throw new ArgumentNullException(nameof(@is));

Review Comment:
   Please add a comment after this line `// LUCENENET specific - added null guard clause`



##########
src/Lucene.Net/Store/OutputStreamDataOutput.cs:
##########
@@ -25,21 +25,21 @@ namespace Lucene.Net.Store
     /// </summary>
     public class OutputStreamDataOutput : DataOutput, IDisposable
     {
-        private readonly BinaryWriter _writer;
+        private readonly Stream _os;
 
         public OutputStreamDataOutput(Stream os)
         {
-            this._writer = new BinaryWriter(os);
+            this._os = os;

Review Comment:
   Please add a null guard clause here, as well. Add a comment after this line `// LUCENENET specific - added null guard clause`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org