Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  ByteBuffer in Java

ByteBuffer is introduced in java.nio since Java 1.4. It provides a way of representing raw structured data such as from a file or from network. It enables fast access of underlying data compared to traditional ways like byte[]Prior to Java 1.4, if you want to represent a structured raw data, you need to create a byte[] and then having a set of checks to delimit the byte array to get the expected tokens.There are three ways to create a ByteBuffer:Wrapping an exiting array by calling ByteBuffer.wrap();Creating an empty buffer with capacity by calling ByteBuffer.allocate();Creating an direct empt...

3,112 0       JAVA BYTEBUFFER ALLOCATION