HexOutStream::overrun(int itemSize, int nItems) {
  if (itemSize > bufSize)
    throw Exception("HexOutStream overrun: max itemSize exceeded");

  writeBuffer();

  if (itemSize * nItems > end - ptr)
    nItems = (end - ptr) / itemSize;

  return nItems;
}