Data Buffers and Codecs
Java NIO provides ByteBuffer
but many libraries build their own byte buffer API on top,
especially for network operations where reusing buffers and/or using direct buffers is
beneficial for performance. For example Netty has the ByteBuf
hierarchy, Undertow uses
XNIO, Jetty uses pooled byte buffers with a callback to be released, and so on.
The spring-core
module provides a set of abstractions to work with various byte buffer
APIs as follows:
-
databuffers-factory abstracts the creation of a data buffer.
-
databuffers-buffer represents a byte buffer, which may be pooled.
-
databuffers-utils offers utility methods for data buffers.
-
Codecs decode or encode streams data buffer streams into higher level objects.