What is the use of ByteBuffer in Java?

Aklin picture Aklin · Jan 30, 2011 · Viewed 218.2k times · Source

What are example applications for a ByteBuffer in Java? Please list any example scenarios where this is used. Thank you!

Answer

kelloti picture kelloti · Jan 30, 2011

This is a good description of its uses and shortcomings. You essentially use it whenever you need to do fast low-level I/O. If you were going to implement a TCP/IP protocol or if you were writing a database (DBMS) this class would come in handy.