iverase opened a new issue, #12599:
URL: https://github.com/apache/lucene/issues/12599

   We can currently read a RandomAccessInput byte by byte but it does not 
provide a method to bulk read a chunck of bytes, similary to what DataInput 
provides with DataInput#readBytes(byte[], int, int). Therefore I would like to 
propose to add it with a default implementation that reads bye per byte:
   
   ```
     /**
      * Reads a specified number of bytes starting at a given position into an 
array at the specified
      * offset.
      *
      * @see DataInput#readBytes
      */
     default void readBytes(long pos, byte[] bytes, int offset, int length) 
throws IOException {
       for (int i = 0; i < length; i++) {
         bytes[offset + i] = readByte(pos + i);
       }
     }
   ```
   
   We can add faster implementation for all know implementations in Lucene code 
base.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to