code: public void shrink(int delta) {
          if (delta <= 0) {
              return;
          }
  
          int newLimit = buffer.limit() - delta;
          if (newLimit <= 0) {
              newLimit = 0;
          }
          this.buffer.limit(newLimit);
      }
docs: Shrink the buffer of this packet by specified length
  
  @param len length to shrink