private String reEncodeWriteAccessIfNecessary( String writeAccess ) { if ( writeAccess == null || writeAccess.length() == 0 ) { return writeAccess; } byte[] data = new byte[112]; try { // jxl reads writeAccess with "UnicodeLittle" encoding, but will try to write later with "file.encoding" // this throws an ArrayIndexOutOfBoundsException in *nix systems StringHelper.getBytes( writeAccess, data, 0 ); } catch ( ArrayIndexOutOfBoundsException e ) { try { // properly re-encoding string from UnicodeLittle, removing BOM characters return new String( writeAccess.getBytes( "UnicodeLittle" ), System.getProperty( "file.encoding" ) ).substring( 2 ); } catch ( UnsupportedEncodingException e1 ) { logError( Const.getStackTracker( e ) ); } } return writeAccess; } }
/** * Inserts a row * * @param row the row to insert */ public void insertRow(int row) { if (dvParser == null) { initialize(); } dvParser.insertRow(row); }
/** * Accessor for first column * * @return the first column */ public int getFirstColumn() { if (dvParser == null) { initialize(); } return dvParser.getFirstColumn(); }
/** * Accessor for the last column * * @return the last column */ public int getLastColumn() { if (dvParser == null) { initialize(); } return dvParser.getLastColumn(); }
/** * Accessor for first row * * @return the first row */ public int getFirstRow() { if (dvParser == null) { initialize(); } return dvParser.getFirstRow(); }
/** * Gets the data to write to the output file * * @return the binary data */ public byte[] getData() { byte[] mydata = new byte[6]; IntegerHelper.getTwoBytes(row, mydata, 0); IntegerHelper.getTwoBytes(column, mydata, 2); IntegerHelper.getTwoBytes(format.getXFIndex(), mydata, 4); return mydata; }
/** * Inserts a row * * @param col the row to insert */ public void insertColumn(int col) { if (dvParser == null) { initialize(); } dvParser.insertColumn(col); }
/** * Removes a row * * @param row the row to insert */ public void removeRow(int row) { if (dvParser == null) { initialize(); } dvParser.removeRow(row); }
/** * Accessor for the last row * * @return the last row */ public int getLastRow() { if (dvParser == null) { initialize(); } return dvParser.getLastRow(); }
/** * Removes a column * * @param col the row to insert */ public void removeColumn(int col) { if (dvParser == null) { initialize(); } dvParser.removeColumn(col); }
/** * Turns bold printing on or off. Bold printing * is initially off. Text subsequently appended to * this object will be bolded until this method is * called again. */ protected void toggleBold() { appendInternal(BOLD_TOGGLE); }
/** * Expose the protected function to the SheetImpl in this package * * @return the raw record data */ public Record getRecord() { return super.getRecord(); }
/** * Accessor for first column * * @return the first column */ public int getFirstColumn() { if (dvParser == null) { initialize(); } return dvParser.getFirstColumn(); }
/** * Accessor for the last column * * @return the last column */ public int getLastColumn() { if (dvParser == null) { initialize(); } return dvParser.getLastColumn(); }
/** * Accessor for first row * * @return the first row */ public int getFirstRow() { if (dvParser == null) { initialize(); } return dvParser.getFirstRow(); }
/** * Gets the data to write to the output file * * @return the binary data */ public byte[] getData() { byte[] mydata = new byte[6]; IntegerHelper.getTwoBytes(row, mydata, 0); IntegerHelper.getTwoBytes(column, mydata, 2); IntegerHelper.getTwoBytes(format.getXFIndex(), mydata, 4); return mydata; }
/** * Inserts a row * * @param col the row to insert */ public void insertColumn(int col) { if (dvParser == null) { initialize(); } dvParser.insertColumn(col); }
/** * Removes a row * * @param row the row to insert */ public void removeRow(int row) { if (dvParser == null) { initialize(); } dvParser.removeRow(row); }
/** * Turns italics printing on or off. Italics printing * is initially off. Text subsequently appended to * this object will be italicized until this method is * called again. */ protected void toggleItalics() { appendInternal(ITALICS_TOGGLE); }
/** * Accessor for the record. Used when forcibly changing this record * into another type, notably a drawing record, as sometimes Excel appears * to switch to writing Continue records instead of MsoDrawing records * * @return the record */ public Record getRecord() { return super.getRecord(); }