public int getLength() {
            return count;
        }
A reusable {@link java.io.DataOutput} implementation that writes to an in-memory buffer.

This saves memory over creating a new DataOutputStream and
ByteArrayOutputStream each time data is written.

Typical usage is something like the following:

DataOutputBuffer buffer = new DataOutputBuffer();
while (... loop condition ...) {
  buffer.reset();
  ... write buffer using DataOutput methods ...
  byte[] data = buffer.getData();
  int dataLength = buffer.getLength();
  ... write data to its ultimate destination ...
}
inlong-common/src/main/java/org/apache/inlong/common/msg/DataOutputBuffer.java