/** * Reads the ptg data from the array starting at the specified position * * @param data the RPN array * @param pos the current position in the array, excluding the ptg identifier * @return the number of bytes read */ public int read(byte[] data, int pos) { int length = data[pos] & 0xff; int consumed = 2; if ((data[pos+1] & 0x01) == 0) { value = StringHelper.getString(data, length, pos+2, settings); consumed += length; } else { value = StringHelper.getUnicodeString(data, length, pos+2); consumed += length * 2; } return consumed; }
/** * Reads the ptg data from the array starting at the specified position * * @param data the RPN array * @param pos the current position in the array, excluding the ptg identifier * @return the number of bytes read */ public int read(byte[] data, int pos) { int length = data[pos] & 0xff; int consumed = 2; if ((data[pos+1] & 0x01) == 0) { value = StringHelper.getString(data, length, pos+2, settings); consumed += length; } else { value = StringHelper.getUnicodeString(data, length, pos+2); consumed += length * 2; } return consumed; }
/** * Constructs this object from the raw data * * @param t the record data * @param ws the workbook settings * @param dummy dummy record to indicate a biff7 document */ FooterRecord(Record t, WorkbookSettings ws, Biff7 dummy) { super(t); byte[] data = getRecord().getData(); if (data.length == 0) { return; } int chars = data[0]; footer = StringHelper.getString(data, chars, 1, ws); }
/** * Constructs this object from the raw data * * @param t the record data * @param ws the workbook settings * @param dummy dummy record to indicate a biff7 document */ HeaderRecord(Record t, WorkbookSettings ws, Biff7 dummy) { super(t); byte[] data = getRecord().getData(); if (data.length == 0) { return; } int chars = data[0]; header = StringHelper.getString(data, chars, 1, ws); }
/** * Constructs this object from the raw data * * @param t the record data * @param ws the workbook settings * @param dummy dummy record to indicate a biff7 document */ HeaderRecord(Record t, WorkbookSettings ws, Biff7 dummy) { super(t); byte[] data = getRecord().getData(); if (data.length == 0) { return; } int chars = data[0]; header = StringHelper.getString(data, chars, 1, ws); }
/** * Constructs this object from the raw data * * @param t the record data * @param ws the workbook settings * @param dummy dummy record to indicate a biff7 document */ FooterRecord(Record t, WorkbookSettings ws, Biff7 dummy) { super(t); byte[] data = getRecord().getData(); if (data.length == 0) { return; } int chars = data[0]; footer = StringHelper.getString(data, chars, 1, ws); }
/** * Constructor * * @param t the raw bytes * @param isBiff8 Is record BIFF8 (else BIFF7) */ public WriteAccessRecord(Record t, boolean isBiff8, WorkbookSettings ws) { super(Type.WRITEACCESS); byte[] data = t.getData(); if (isBiff8) { wauser= StringHelper.getUnicodeString(data, 112/2, 0); } else { // BIFF7 does not use unicode encoding in string int length= data[1]; wauser= StringHelper.getString(data, length, 1, ws); } }
/** * Constructor * * @param t the raw bytes * @param isBiff8 Is record BIFF8 (else BIFF7) */ public WriteAccessRecord(Record t, boolean isBiff8, WorkbookSettings ws) { super(Type.WRITEACCESS); byte[] data = t.getData(); if (isBiff8) { wauser= StringHelper.getUnicodeString(data, 112/2, 0); } else { // BIFF7 does not use unicode encoding in string int length= data[1]; wauser= StringHelper.getString(data, length, 1, ws); } }
s = StringHelper.getString(data, data.length, 0, ws);
/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param ws the workbook settings * @param dummy dummy overload to indicate a biff 7 workbook */ public RStringRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws, Biff7 dummy) { super(t, fr, si); byte[] data = getRecord().getData(); length = IntegerHelper.getInt(data[6], data[7]); string = StringHelper.getString(data, length, 8, ws); }
/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param ws the workbook settings * @param dummy dummy overload to indicate a biff 7 workbook */ public LabelRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws, Biff7 dummy) { super(t, fr, si); byte[] data = getRecord().getData(); length = IntegerHelper.getInt(data[6], data[7]); string = StringHelper.getString(data, length, 8, ws); }
/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param ws the workbook settings * @param dummy dummy overload to indicate a biff 7 workbook */ public RStringRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws, Biff7 dummy) { super(t, fr, si); byte[] data = getRecord().getData(); length = IntegerHelper.getInt(data[6], data[7]); string = StringHelper.getString(data, length, 8, ws); }
/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param ws the workbook settings * @param dummy dummy overload to indicate a biff 7 workbook */ public LabelRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws, Biff7 dummy) { super(t, fr, si); byte[] data = getRecord().getData(); length = IntegerHelper.getInt(data[6], data[7]); string = StringHelper.getString(data, length, 8, ws); }
/** * Accessor for the text on the button * * @return the button text */ public String getText() { if (commentText == null) { Assert.verify(text != null); byte[] td = text.getData(); if (td[0] == 0) { commentText = StringHelper.getString (td, td.length - 1, 1, workbookSettings); } else { commentText = StringHelper.getUnicodeString (td, (td.length - 1) / 2, 1); } } return commentText; }
/** * Accessor for the text on the button * * @return the button text */ public String getText() { if (commentText == null) { Assert.verify(text != null); byte[] td = text.getData(); if (td[0] == 0) { commentText = StringHelper.getString (td, td.length - 1, 1, workbookSettings); } else { commentText = StringHelper.getUnicodeString (td, (td.length - 1) / 2, 1); } } return commentText; }
/** * Accessor for the comment text * * @return the comment text */ public String getText() { if (commentText == null) { Assert.verify(text != null); byte[] td = text.getData(); if (td[0] == 0) { commentText = StringHelper.getString (td, td.length - 1, 1, workbookSettings); } else { commentText = StringHelper.getUnicodeString (td, (td.length - 1) / 2, 1); } } return commentText; }
/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param ws the workbook settings */ public LabelRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws) { super(t, fr, si); byte[] data = getRecord().getData(); length = IntegerHelper.getInt(data[6], data[7]); if (data[8] == 0x0) { string = StringHelper.getString(data, length, 9, ws); } else { string = StringHelper.getUnicodeString(data, length, 9); } }
/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param ws the workbook settings */ public LabelRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws) { super(t, fr, si); byte[] data = getRecord().getData(); length = IntegerHelper.getInt(data[6], data[7]); if (data[8] == 0x0) { string = StringHelper.getString(data, length, 9, ws); } else { string = StringHelper.getUnicodeString(data, length, 9); } }
/** * Constructs this object from the raw data * * @param t the record data * @param ws the workbook settings */ HeaderRecord(Record t, WorkbookSettings ws) { super(t); byte[] data = getRecord().getData(); if (data.length == 0) { return; } int chars = IntegerHelper.getInt(data[0], data[1]); boolean unicode = data[2] == 1; if (unicode) { header = StringHelper.getUnicodeString(data, chars, 3); } else { header = StringHelper.getString(data, chars, 3, ws); } }
/** * Constructs this object from the raw data * * @param t the record data * @param ws the workbook settings */ FooterRecord(Record t, WorkbookSettings ws) { super(t); byte[] data = getRecord().getData(); if (data.length == 0) { return; } int chars = IntegerHelper.getInt(data[0], data[1]); boolean unicode = data[2] == 1; if (unicode) { footer = StringHelper.getUnicodeString(data, chars, 3); } else { footer = StringHelper.getString(data, chars, 3, ws); } }