code: @Nonnull
    public byte [] getEncodedForPageContentStream (@Nonnull final String sText) throws IOException
    {
      // Minimum is 1*string length
      // Maximum is 4*string length
      try (final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream (sText.length () * 2))
      {
        int nCPOfs = 0;
        while (nCPOfs < sText.length ())
        {
          final int nCP = sText.codePointAt (nCPOfs);
          nCPOfs += Character.charCount (nCP);
  
          final EncodedCodePoint aECP = _getEncodedCodePoint (nCP);
          if (m_bFontWillBeSubset)
            m_aFont.addToSubset (aECP.getCodePoint ());
          aECP.writeEncodedBytes (aBAOS);
        }
        return aBAOS.toByteArray ();
      }
    }
docs: A quick version to encode the passed text so that it can be written with
  <code>COSWriter.writeString</code>
  
  @param sText
  Text to be written.
  @return The byte array that can be written with the COSWrite. Never
  <code>null</code>.
  @throws IOException
  In case something goes wrong