A FlexBuffer wraps a byte array and manages the active region of it (0..length). It also supports dynamically extending the buffer as needed. A FlexBuffer also has an index (read or write cursor). The various get and put operations always occur at the current index, with the index adjusted appropriately afterward. Get will not move index past length. If put needs to move index past length, length is also adjusted. This may cause the byte array to be re-allocated to a larger size.
A FlexBuffer wraps a byte array and manages the active region of it (0..length). It also supports dynamically extending the buffer as needed. A FlexBuffer also has an index (read or write cursor). The various get and put operations always occur at the current index, with the index adjusted appropriately afterward. Get will not move index past length. If put needs to move index past length, length is also adjusted. This may cause the byte array to be re-allocated to a larger size.
A tweaking of the hadoop Buffer class, basically allowing for cheap buffer copies (via underlying storage sharing), some copy on write support, and most importantly, support of offset based backing buffers A byte sequence that is used as a Java native type for buffer. It is resizable and distinguishes between the count of the seqeunce and the current capacity.
@author rana
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.