code: public void setLineCapStyle (final int lineCapStyle) throws IOException
    {
      if (inTextMode)
      {
        throw new IllegalStateException ("Error: setLineCapStyle is not allowed within a text block.");
      }
      if (lineCapStyle >= 0 && lineCapStyle <= 2)
      {
        writeOperand (lineCapStyle);
        writeOperator ((byte) 'J');
      }
      else
      {
        throw new IllegalArgumentException ("Error: unknown value for line cap style");
      }
    }
docs: Set the line cap style.
  
  @param lineCapStyle
  0 for butt cap, 1 for round cap, and 2 for projecting square cap.
  @throws IOException
  If the content stream could not be written.
  @throws IllegalStateException
  If the method was called within a text block.
  @throws IllegalArgumentException
  If the parameter is not a valid line cap style.