code: public Segment split(int byteCount) {
      if (byteCount <= 0 || byteCount > limit - pos) throw new IllegalArgumentException();
      Segment prefix = new Segment(this);
      prefix.limit = prefix.pos + byteCount;
      pos += byteCount;
      prev.push(prefix);
      return prefix;
    }
docs: Splits this head of a circularly-linked list into two segments. The first
  segment contains the data in {@code [pos..pos+byteCount)}. The second
  segment contains the data in {@code [pos+byteCount..limit)}. This can be
  useful when moving partial segments from one buffer to another.
  
  <p>Returns the new head of the circularly-linked list.