code: public void writeContent(final OutputStream result) throws IOException
      {
          if(this.borderStyle == BORDER_NONE || this.borderPosition == NO_BORDER || this.borderWidth == 0) {
              return;
          }
  
      	if(this.borderType == ROW_BORDER) {
              switch(this.borderPosition) {
                  case LEFT_BORDER:
                      result.write(ROW_BORDER_LEFT);
                  	break;
                  case TOP_BORDER:
                      result.write(ROW_BORDER_TOP);
                      break;
                  case RIGHT_BORDER:
                      result.write(ROW_BORDER_RIGHT);
                      break;
                  case BOTTOM_BORDER:
                      result.write(ROW_BORDER_BOTTOM);
                      break;
                  case HORIZONTAL_BORDER:
                      result.write(ROW_BORDER_HORIZONTAL);
                      break;
                  case VERTICAL_BORDER:
                      result.write(ROW_BORDER_VERTICAL);
                      break;
                  default:
                      return;
              }
              result.write(writeBorderStyle());
              result.write(BORDER_WIDTH);
              result.write(intToByteArray(this.borderWidth));
              result.write(BORDER_COLOR_NUMBER);
              result.write(intToByteArray(this.borderColor.getColorNumber()));
              this.document.outputDebugLinebreak(result);
          } else if(this.borderType == CELL_BORDER) {
              switch(this.borderPosition) {
                  case LEFT_BORDER:
                      result.write(CELL_BORDER_LEFT);
                  	break;
                  case TOP_BORDER:
                      result.write(CELL_BORDER_TOP);
                      break;
                  case RIGHT_BORDER:
                      result.write(CELL_BORDER_RIGHT);
                      break;
                  case BOTTOM_BORDER:
                      result.write(CELL_BORDER_BOTTOM);
                      break;
                  default:
                      return;
              }
              result.write(writeBorderStyle());
              result.write(BORDER_WIDTH);
              result.write(intToByteArray(this.borderWidth));
              result.write(BORDER_COLOR_NUMBER);
              result.write(intToByteArray(this.borderColor.getColorNumber()));
              this.document.outputDebugLinebreak(result);
          }    	
      }
docs: Writes the RtfBorder settings