How can read/write in a short buffer?
I’m trying to implement a BufferedReader and Writer for short values. Each times will be passed a short[] and will be read a short[].
But the java API doesn’t have this interface, only byte[].
What’s the best way to implement this feature?
Well, for your BufferedInputStream (not reader), you could try reading 2 bytes at the same time:
For your BufferedOutputStream (not writer), you could try the reverse operation for writing 2 bytes at the same time.