/** * InputStream <tt>in</tt> is expected to contain: * <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 * #readUnicodeString(LittleEndianInput)} can be used. */ public static String readUnicodeString(LittleEndianInput in, int nChars) { byte is16Bit = in.readByte(); if ((is16Bit & 0x01) == 0) { return readCompressedUnicode(in, nChars); } return readUnicodeLE(in, nChars); }
/** Create a StringPtg from a stream */ public StringPtg(LittleEndianInput in) { int nChars = in.readUByte(); // Note - nChars is 8-bit _is16bitUnicode = (in.readByte() & 0x01) != 0; if (_is16bitUnicode) { field_3_string = StringUtil.readUnicodeLE(in, nChars); } else { field_3_string = StringUtil.readCompressedUnicode(in, nChars); } }
/** * InputStream <tt>in</tt> is expected to contain: * <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. * <p> * This structure is also known as a XLUnicodeString. */ public static String readUnicodeString(LittleEndianInput in) { int nChars = in.readUShort(); byte flag = in.readByte(); if ((flag & 0x01) == 0) { return readCompressedUnicode(in, nChars); } return readUnicodeLE(in, nChars); }
/** * @param ris the RecordInputstream to read the record from */ public NameCommentRecord(final RecordInputStream ris) { field_1_record_type = ris.readShort(); field_2_frt_cell_ref_flag = ris.readShort(); field_3_reserved = ris.readLong(); final int field_4_name_length = ris.readShort(); final int field_5_comment_length = ris.readShort(); if (ris.readByte() == 0) { field_6_name_text = StringUtil.readCompressedUnicode(ris, field_4_name_length); } else { field_6_name_text = StringUtil.readUnicodeLE(ris, field_4_name_length); } if (ris.readByte() == 0) { field_7_comment_text = StringUtil.readCompressedUnicode(ris, field_5_comment_length); } else { field_7_comment_text = StringUtil.readUnicodeLE(ris, field_5_comment_length); } }
field_12_name_text = StringUtil.readUnicodeLE(in, field_3_length_name_text); } else { field_12_name_text = StringUtil.readCompressedUnicode(in, field_3_length_name_text); field_14_custom_menu_text = StringUtil.readCompressedUnicode(in, f7_customMenuLen); field_15_description_text = StringUtil.readCompressedUnicode(in, f8_descriptionTextLen); field_16_help_topic_text = StringUtil.readCompressedUnicode(in, f9_helpTopicTextLen); field_17_status_bar_text = StringUtil.readCompressedUnicode(in, f10_statusBarTextLen);
/** * Read the record data from the supplied <code>RecordInputStream</code> * * @param in the RecordInputStream to read from */ public NoteRecord(RecordInputStream in) { field_1_row = in.readUShort(); field_2_col = in.readShort(); field_3_flags = in.readShort(); field_4_shapeid = in.readUShort(); int length = in.readShort(); field_5_hasMultibyte = in.readByte() != 0x00; if (field_5_hasMultibyte) { field_6_author = StringUtil.readUnicodeLE(in, length); } else { field_6_author = StringUtil.readCompressedUnicode(in, length); } if (in.available() == 1) { field_7_padding = Byte.valueOf(in.readByte()); } else if (in.available() == 2 && length == 0) { // If there's no author, may be double padded field_7_padding = Byte.valueOf(in.readByte()); in.readByte(); } }
rawText = StringUtil.readCompressedUnicode(in, nChars); } else { rawText = StringUtil.readUnicodeLE(in, nChars);
public StyleRecord(RecordInputStream in) { field_1_xf_index = in.readShort(); if (isBuiltin()) { field_2_builtin_style = in.readByte(); field_3_outline_style_level = in.readByte(); } else { int field_2_name_length = in.readShort(); if(in.remaining() < 1) { // Some files from Crystal Reports lack the is16BitUnicode byte // the remaining fields, which is naughty if (field_2_name_length != 0) { throw new RecordFormatException("Ran out of data reading style record"); } // guess this is OK if the string length is zero field_4_name = ""; } else { field_3_stringHasMultibyte = in.readByte() != 0x00; if (field_3_stringHasMultibyte) { field_4_name = StringUtil.readUnicodeLE(in, field_2_name_length); } else { field_4_name = StringUtil.readCompressedUnicode(in, field_2_name_length); } } } }
stringByteCount += nChars * 2; } else { field_4_ole_classname = StringUtil.readCompressedUnicode(in, nChars); stringByteCount += nChars;
_shortFilename = StringUtil.readCompressedUnicode(in, len); _uninterpretedTail = readTail(FILE_TAIL, in); int size = in.readInt();
/** * InputStream <tt>in</tt> is expected to contain: * <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 * #readUnicodeString(LittleEndianInput)} can be used. */ public static String readUnicodeString(LittleEndianInput in, int nChars) { byte is16Bit = in.readByte(); if ((is16Bit & 0x01) == 0) { return readCompressedUnicode(in, nChars); } return readUnicodeLE(in, nChars); }
/** * InputStream <tt>in</tt> is expected to contain: * <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 * #readUnicodeString(LittleEndianInput)} can be used. */ public static String readUnicodeString(LittleEndianInput in, int nChars) { byte is16Bit = in.readByte(); if ((is16Bit & 0x01) == 0) { return readCompressedUnicode(in, nChars); } return readUnicodeLE(in, nChars); } /**
/** Create a StringPtg from a stream */ public StringPtg(LittleEndianInput in) { int nChars = in.readUByte(); // Note - nChars is 8-bit _is16bitUnicode = (in.readByte() & 0x01) != 0; if (_is16bitUnicode) { field_3_string = StringUtil.readUnicodeLE(in, nChars); } else { field_3_string = StringUtil.readCompressedUnicode(in, nChars); } }
/** Create a StringPtg from a stream */ public StringPtg(LittleEndianInput in) { int nChars = in.readUByte(); // Note - nChars is 8-bit _is16bitUnicode = (in.readByte() & 0x01) != 0; if (_is16bitUnicode) { field_3_string = StringUtil.readUnicodeLE(in, nChars); } else { field_3_string = StringUtil.readCompressedUnicode(in, nChars); } }
/** Create a StringPtg from a stream */ public StringPtg(LittleEndianInput in) { int nChars = in.readUByte(); // Note - nChars is 8-bit _is16bitUnicode = (in.readByte() & 0x01) != 0; if (_is16bitUnicode) { field_3_string = StringUtil.readUnicodeLE(in, nChars); } else { field_3_string = StringUtil.readCompressedUnicode(in, nChars); } }
/** * InputStream <tt>in</tt> is expected to contain: * <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. * <p> * This structure is also known as a XLUnicodeString. */ public static String readUnicodeString(LittleEndianInput in) { int nChars = in.readUShort(); byte flag = in.readByte(); if ((flag & 0x01) == 0) { return readCompressedUnicode(in, nChars); } return readUnicodeLE(in, nChars); }
/** * @param ris the RecordInputstream to read the record from */ public NameCommentRecord(final RecordInputStream ris) { final LittleEndianInput in = ris; field_1_record_type = in.readShort(); field_2_frt_cell_ref_flag = in.readShort(); field_3_reserved = in.readLong(); final int field_4_name_length = in.readShort(); final int field_5_comment_length = in.readShort(); in.readByte(); //spurious NUL field_6_name_text = StringUtil.readCompressedUnicode(in, field_4_name_length); in.readByte(); //spurious NUL field_7_comment_text = StringUtil.readCompressedUnicode(in, field_5_comment_length); }
/** * @param ris the RecordInputstream to read the record from */ public NameCommentRecord(final RecordInputStream ris) { final LittleEndianInput in = ris; field_1_record_type = in.readShort(); field_2_frt_cell_ref_flag = in.readShort(); field_3_reserved = in.readLong(); final int field_4_name_length = in.readShort(); final int field_5_comment_length = in.readShort(); in.readByte(); //spurious NUL field_6_name_text = StringUtil.readCompressedUnicode(in, field_4_name_length); in.readByte(); //spurious NUL field_7_comment_text = StringUtil.readCompressedUnicode(in, field_5_comment_length); }
/** * Read the record data from the supplied <code>RecordInputStream</code> */ public NoteRecord(RecordInputStream in) { field_1_row = in.readUShort(); field_2_col = in.readShort(); field_3_flags = in.readShort(); field_4_shapeid = in.readUShort(); int length = in.readShort(); field_5_hasMultibyte = in.readByte() != 0x00; if (field_5_hasMultibyte) { field_6_author = StringUtil.readUnicodeLE(in, length); } else { field_6_author = StringUtil.readCompressedUnicode(in, length); } if (in.available() == 1) { field_7_padding = Byte.valueOf(in.readByte()); } }
/** * Read the record data from the supplied <code>RecordInputStream</code> */ public NoteRecord(RecordInputStream in) { field_1_row = in.readUShort(); field_2_col = in.readShort(); field_3_flags = in.readShort(); field_4_shapeid = in.readUShort(); int length = in.readShort(); field_5_hasMultibyte = in.readByte() != 0x00; if (field_5_hasMultibyte) { field_6_author = StringUtil.readUnicodeLE(in, length); } else { field_6_author = StringUtil.readCompressedUnicode(in, length); } if (in.available() == 1) { field_7_padding = Byte.valueOf(in.readByte()); } }