code: public void truncate(int size) {
  
          ensureCapacity(size);
          int minSize = Math.min(size, m_size);
          int maxSize = Math.max(size, m_size);
          Arrays.fill(m_buffer, minSize, maxSize, (byte)0);
          m_size = size;
      }
docs: Changes the logical size of this buffer.<p>
  
  If the size is larger than the current size, the new space will be filled with 0s.
  Note that the internal byte buffer will not be shrunk if the size is smaller than the current
  size.<p>
  
  @param size the new size