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) { // TODO - junit out.writeShort(getReadOnly()); out.writeShort(getPassword()); out.writeShort(field_3_username_value.length()); if(field_3_username_value.length() > 0) { out.writeByte(field_3_username_unicode_options); StringUtil.putCompressedUnicode(getUsername(), 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() {
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.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); } }
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()); } }
@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); } }
StringUtil.putUnicodeLE(nameText, out); } else { StringUtil.putCompressedUnicode(nameText, out); field_13_name_definition.serializeArrayConstantData(out); StringUtil.putCompressedUnicode( getCustomMenuText(), out); StringUtil.putCompressedUnicode( getDescriptionText(), out); StringUtil.putCompressedUnicode( getHelpTopicText(), out); StringUtil.putCompressedUnicode( getStatusBarText(), out);
@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); } } }
out.writeShort(_fileOpts); out.writeInt(_shortFilename.length()); StringUtil.putCompressedUnicode(_shortFilename, out); writeTail(_uninterpretedTail, out); if (_address == null) {
pos += stringLen * 2; } else { StringUtil.putCompressedUnicode(field_4_ole_classname, out); pos += stringLen;
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 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) { // TODO - junit out.writeShort(getReadOnly()); out.writeShort(getPassword()); out.writeShort(field_3_username_value.length()); if(field_3_username_value.length() > 0) { out.writeByte(field_3_username_unicode_options); StringUtil.putCompressedUnicode(getUsername(), 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() {
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); } } }