@Override protected void serialize(LittleEndianOutput out) { out.writeShort(rt); out.writeShort(grbitFrt); out.write(unused); out.writeInt(cts); out.writeShort(rgchDefListStyle.length()); out.writeShort(rgchDefPivotStyle.length()); StringUtil.putUnicodeLE(rgchDefListStyle, out); StringUtil.putUnicodeLE(rgchDefPivotStyle, out); }
public void write(LittleEndianOutput out) { out.writeByte(sid + getPtgClass()); out.writeByte(field_3_string.length()); // Note - nChars is 8-bit out.writeByte(_is16bitUnicode ? 0x01 : 0x00); if (_is16bitUnicode) { StringUtil.putUnicodeLE(field_3_string, out); } else { StringUtil.putCompressedUnicode(field_3_string, out); } }
public void serialize(LittleEndianOutput out) { out.writeShort(field_1_id); out.writeByte(field_4_text.length()); if (is16bit) { // Excel (2007) seems to choose 16bit regardless of whether it is needed out.writeByte(0x01); StringUtil.putUnicodeLE(field_4_text, out); } else { // Excel can read this OK out.writeByte(0x00); StringUtil.putCompressedUnicode(field_4_text, out); } }
/** * OutputStream <tt>out</tt> will get: * <ol> * <li>ushort nChars</li> * <li>byte is16BitFlag</li> * <li>byte[]/char[] characterData</li> * </ol> * For this encoding, the is16BitFlag is always present even if nChars==0. */ public static void writeUnicodeString(LittleEndianOutput out, String value) { int nChars = value.length(); out.writeShort(nChars); boolean is16Bit = hasMultibyte(value); out.writeByte(is16Bit ? 0x01 : 0x00); if (is16Bit) { putUnicodeLE(value, out); } else { putCompressedUnicode(value, out); } }
public void serialize(LittleEndianOutput out) { String username = getUsername(); boolean is16bit = StringUtil.hasMultibyte(username); out.writeShort(username.length()); out.writeByte(is16bit ? 0x01 : 0x00); if (is16bit) { StringUtil.putUnicodeLE(username, out); } else { StringUtil.putCompressedUnicode(username, out); } int encodedByteCount = 3 + username.length() * (is16bit ? 2 : 1); int paddingSize = DATA_SIZE - encodedByteCount; out.write(PADDING, 0, paddingSize); }
/** * OutputStream <tt>out</tt> will get: * <ol> * <li>byte is16BitFlag</li> * <li>byte[]/char[] characterData</li> * </ol> * For this encoding, the is16BitFlag is always present even if nChars==0. * <br> * This method should be used when the nChars field is <em>not</em> stored * as a ushort immediately before the is16BitFlag. Otherwise, {@link * #writeUnicodeString(LittleEndianOutput, String)} can be used. */ public static void writeUnicodeStringFlagAndData(LittleEndianOutput out, String value) { boolean is16Bit = hasMultibyte(value); out.writeByte(is16Bit ? 0x01 : 0x00); if (is16Bit) { putUnicodeLE(value, out); } else { putCompressedUnicode(value, out); } }
public void serialize(LittleEndianOutput out) { String formatString = getFormatString(); out.writeShort(getIndexCode()); out.writeShort(formatString.length()); out.writeByte(field_3_hasMultibyte ? 0x01 : 0x00); if ( field_3_hasMultibyte ) { StringUtil.putUnicodeLE( formatString, out); } else { StringUtil.putCompressedUnicode( formatString, out); } } protected int getDataSize() {
StringUtil.putUnicodeLE(_label, out); StringUtil.putUnicodeLE(_targetFrame, out); StringUtil.putUnicodeLE(_address, out); if (_uninterpretedTail == null) { out.writeInt(_address.length()*2); StringUtil.putUnicodeLE(_address, out); } else { out.writeInt(_address.length()*2 + TAIL_SIZE); StringUtil.putUnicodeLE(_address, out); writeTail(_uninterpretedTail, out); out.writeInt(addrLen); out.writeShort(0x0003); // TODO const StringUtil.putUnicodeLE(_address, out); StringUtil.putUnicodeLE(_textMark, out);
public final void serialize(LittleEndianOutput out) { if (getTextLength() > 0) { out.writeShort(getTextLength()); out.writeByte(field_2_hasMultibyte ? 0x01 : 0x00); if (field_2_hasMultibyte) { StringUtil.putUnicodeLE(field_3_text, out); } else { StringUtil.putCompressedUnicode(field_3_text, out); } } }
public void serialize(LittleEndianOutput out) { out.writeShort(field_1_row); out.writeShort(field_2_col); out.writeShort(field_3_flags); out.writeShort(field_4_shapeid); out.writeShort(field_6_author.length()); out.writeByte(field_5_hasMultibyte ? 0x01 : 0x00); if (field_5_hasMultibyte) { StringUtil.putUnicodeLE(field_6_author, out); } else { StringUtil.putCompressedUnicode(field_6_author, out); } if (field_7_padding != null) { out.writeByte(field_7_padding.intValue()); } }
public void serialize(LittleEndianOutput out) { out.writeInt(getPositionOfBof()); out.writeShort(field_2_option_flags); String name = field_5_sheetname; out.writeByte(name.length()); out.writeByte(field_4_isMultibyteUnicode); if (isMultibyte()) { StringUtil.putUnicodeLE(name, out); } else { StringUtil.putCompressedUnicode(name, out); } }
@Override public void serialize(final LittleEndianOutput out) { final int field_4_name_length = field_6_name_text.length(); final int field_5_comment_length = field_7_comment_text.length(); out.writeShort(field_1_record_type); out.writeShort(field_2_frt_cell_ref_flag); out.writeLong(field_3_reserved); out.writeShort(field_4_name_length); out.writeShort(field_5_comment_length); boolean isNameMultiByte = StringUtil.hasMultibyte(field_6_name_text); out.writeByte(isNameMultiByte ? 1 : 0); if (isNameMultiByte) { StringUtil.putUnicodeLE(field_6_name_text, out); } else { StringUtil.putCompressedUnicode(field_6_name_text, out); } boolean isCommentMultiByte = StringUtil.hasMultibyte(field_7_comment_text); out.writeByte(isCommentMultiByte ? 1 : 0); if (isCommentMultiByte) { StringUtil.putUnicodeLE(field_7_comment_text, out); } else { StringUtil.putCompressedUnicode(field_7_comment_text, out); } }
protected void serialize(ContinuableRecordOutput out) { int dataSize = getDataSize(); out.writeContinueIfRequired(8); out.writeShort(reserved); out.writeShort(dataSize); out.writeShort(formattingFontIndex); out.writeShort(formattingOptions); out.writeContinueIfRequired(6); out.writeShort(numberOfRuns); out.writeShort(phoneticText.length()); out.writeShort(phoneticText.length()); out.writeContinueIfRequired(phoneticText.length()*2); StringUtil.putUnicodeLE(phoneticText, out); for(int i=0; i<phRuns.length; i++) { phRuns[i].serialize(out); } out.write(extraData); }
@Override public void serialize(LittleEndianOutput out) { out.writeShort(field_1_xf_index); if (isBuiltin()) { out.writeByte(field_2_builtin_style); out.writeByte(field_3_outline_style_level); } else { out.writeShort(field_4_name.length()); out.writeByte(field_3_stringHasMultibyte ? 0x01 : 0x00); if (field_3_stringHasMultibyte) { StringUtil.putUnicodeLE(getName(), out); } else { StringUtil.putCompressedUnicode(getName(), out); } } }
@Override protected void serialize(LittleEndianOutput out) { out.writeInt(_grbit1); out.writeByte(_grbit2); out.writeByte(_citmShow); out.writeShort(_isxdiSort); out.writeShort(_isxdiShow); if (_subtotalName == null) { out.writeShort(STRING_NOT_PRESENT_LEN); } else { out.writeShort(_subtotalName.length()); } out.writeInt(_reserved1); out.writeInt(_reserved2); if (_subtotalName != null) { StringUtil.putUnicodeLE(_subtotalName, out); } }
StringUtil.putUnicodeLE(field_4_ole_classname, out); pos += stringLen * 2; } else {
String nameText = field_12_name_text; if (field_11_nameIsMultibyte) { StringUtil.putUnicodeLE(nameText, out); } else { StringUtil.putCompressedUnicode(nameText, out);
public void serialize(LittleEndianOutput out) { out.writeShort(getFontHeight()); out.writeShort(getAttributes()); out.writeShort(getColorPaletteIndex()); out.writeShort(getBoldWeight()); out.writeShort(getSuperSubScript()); out.writeByte(getUnderline()); out.writeByte(getFamily()); out.writeByte(getCharset()); out.writeByte(field_9_zero); int fontNameLen = field_11_font_name.length(); out.writeByte(fontNameLen); boolean hasMultibyte = StringUtil.hasMultibyte(field_11_font_name); out.writeByte(hasMultibyte ? 0x01 : 0x00); if (fontNameLen > 0) { if (hasMultibyte) { StringUtil.putUnicodeLE(field_11_font_name, out); } else { StringUtil.putCompressedUnicode(field_11_font_name, out); } } } protected int getDataSize() {
public void serialize(LittleEndianOutput out) { String formatString = getFormatString(); out.writeShort(getIndexCode()); out.writeShort(formatString.length()); out.writeByte(field_3_hasMultibyte ? 0x01 : 0x00); if ( field_3_hasMultibyte ) { StringUtil.putUnicodeLE( formatString, out); } else { StringUtil.putCompressedUnicode( formatString, out); } } protected int getDataSize() {
public final void serialize(LittleEndianOutput out) { if (getTextLength() > 0) { out.writeShort(getTextLength()); out.writeByte(field_2_hasMultibyte ? 0x01 : 0x00); if (field_2_hasMultibyte) { StringUtil.putUnicodeLE(field_3_text, out); } else { StringUtil.putCompressedUnicode(field_3_text, out); } } }