Java-Byte Ordering

Byte Ordering All primitive types are composed of several bytes: a character or a short integer occupies 2 bytes, a 32-bit integer or a floating-point value occupies 4 bytes, and a long integer or a double precision floating-point value occupies 8 bytes. Each value of one of these multibyte types is stored in a sequence of contiguous memory locations. … Read more…

Java-Slice Buffer

Slice Buffer Slicing a buffer is similar to duplicating, but slice( ) creates a new buffer that starts at the original buffer’s current position and whose capacity is the number of elements remaining in the original buffer (limit – position). The new buffer shares a subsequence of the data elements of the original buffer. The … Read more…

Java-View Buffer

View Buffer Buffers can manage data stored in other buffers. When you create a buffer that manages another buffer’s data, the created buffer is known as view buffer. Changes made in either buffer are reflected in the other. View buffers are created by calling a Buffer subclass’s duplicate( ) method. The resulting view buffer is equivalent … Read more…