[ 
https://issues.apache.org/jira/browse/IO-670?focusedWorklogId=466701&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466701
 ]

ASF GitHub Bot logged work on IO-670:
-------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Aug/20 10:00
            Start Date: 05/Aug/20 10:00
    Worklog Time Spent: 10m 
      Work Description: sebbASF commented on a change in pull request #118:
URL: https://github.com/apache/commons-io/pull/118#discussion_r465613818



##########
File path: 
src/main/java/org/apache/commons/io/input/buffer/UnsyncBufferedInputStream.java
##########
@@ -0,0 +1,207 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.io.input.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+import static org.apache.commons.io.IOUtils.EOF;
+
+/**
+ * A BufferedReader class who does not care about thread safety, but very much 
faster.
+ *
+ * Should be able to replace java.io.BufferedReader in nearly every use-cases 
when you
+ * need the Reader be buffered, but do not need it have thread safety.
+ */
+public class UnsyncBufferedInputStream extends InputStream {
+    protected final InputStream inputStream;
+    protected final byte[] byteBuffer;
+
+    protected int nowIndex = 0;
+    protected int nowLimit = 0;
+

Review comment:
       Fields should be private, otherwise they become part of the API and 
cannot be changed easily.
   They also make thorough testing much harder.
   
   If necessary, getters and/or setters can be added.
   But only if necessary, as they increase the testing requirements, and cannot 
be dropped once added.
   
   Similarly elsewhere.




----------------------------------------------------------------
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.

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 466701)
    Time Spent: 8h 50m  (was: 8h 40m)

> IOUtils.contentEquals is of low performance. I will refine it.
> --------------------------------------------------------------
>
>                 Key: IO-670
>                 URL: https://issues.apache.org/jira/browse/IO-670
>             Project: Commons IO
>          Issue Type: Improvement
>            Reporter: Jin Xu
>            Priority: Critical
>         Attachments: jmh-result.org.apache.json
>
>          Time Spent: 8h 50m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/118]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to