I am writing a program that reads a file (uses a custom buffer, 8 KB), and then finds the keyword in this buffer. Since Java provides two types of streams: character and byte, I implemented this using byte[] and char[] for buffering.
I'm just wondering what would be faster and better for performance, since char is 2 byte , and when using Reader to read char[] , Reader will convert from byte to char , which I think can make it slower than using only byte[] .
source share