code: protected void resizeBuffer (final int additionalLength, final boolean copyData) {
  
          if (additionalLength < 0) { throw new IllegalArgumentException("The length must be greater or equal than 0."); }
  
          dataBuffer.position(length);
  
          // reallocate a bigger dataBuffer, if needed
          if (length + additionalLength > dataBuffer.capacity()) {
  
              final ByteBuffer newBuffer = ByteBuffer.allocate(getTotalLength(length + additionalLength));
  
              // copy old data...
              if (copyData) {
                  dataBuffer.flip();
                  newBuffer.put(dataBuffer);
              }
  
              dataBuffer = newBuffer;
  
              dataBuffer.limit(getTotalLength(length + additionalLength));
          }
  
          length += additionalLength;
      }
docs: This method resizes the data buffer, if necessary. A resizing is not needed, when the <code>neededLength</code>
  is greater than the capacity of allocated data buffer. The flag <code>copyData</code> indicates, if the old
  buffer has to be copied into the new bigger data buffer.
  
  @param additionalLength The length, which is now needed to store all informations in the data buffer.
  @param copyData <code>true</code>, if old buffer has to be copied into the new buffer. <code>false</code>
  indicates, that the new buffer is initialized with zeros.