code: public boolean handleCharacter(int ch) {
  
  		if (this.rtfParser.isImport()) {
  			if (buffer.length() > 254)
  				writeBuffer();
  		}
  		//if(data == null) data = new ByteBuffer();
  		if (dataOS == null) {
  			dataOS = new ByteArrayOutputStream();
  		}
  		switch (dataFormat) {
  		case FORMAT_HEXADECIMAL:
  			hexChars.append((char) ch);
  			if (hexChars.length() == 2) {
  				try {
  					dataOS.write((char) Integer.parseInt(hexChars.toString(),
  							16));
  				} catch (NumberFormatException e) {
  					e.printStackTrace();
  				}
  				hexChars = new StringBuffer();
  			}
  			break;
  		case FORMAT_BINARY:
  			if (dataOS == null) {
  				dataOS = new ByteArrayOutputStream();
  			}
  			// HGS - FIX ME IF PROBLEM!
  			dataOS.write((char) (ch));
  			// PNG signature should be.
  			//			   (decimal)              137  80  78  71  13  10  26  10
  			//			   (hexadecimal)           89  50  4e  47  0d  0a  1a  0a
  			//			   (ASCII C notation)    \211   P   N   G  \r  \n \032 \n
  
  			binaryLength--;
  			if (binaryLength == 0) {
  				dataFormat = FORMAT_HEXADECIMAL;
  			}
  			break;
  		}
  
  		return true;
  	}
docs: /* (non-Javadoc)
  @see com.lowagie.text.rtf.direct.RtfDestination#handleCharacter(int)