public long readUInt() { return readInt() & 0x00FFFFFFFFL; }
void read( LittleEndianByteArrayInputStream lei ) { _size = lei.readUInt(); _indexOffset = lei.readInt(); } }
public void read( LittleEndianByteArrayInputStream lei ) { int offset = lei.getReadIndex(); int size = lei.readInt(); if ( size < 4 ) { String msg = "ClipboardData at offset "+offset+" size less than 4 bytes "+ "(doesn't even have format field!). Setting to format == 0 and hope for the best"; LOG.log( POILogger.WARN, msg); _format = 0; _value = new byte[0]; return; } _format = lei.readInt(); _value = IOUtils.safelyAllocate(size - LittleEndianConsts.INT_SIZE, MAX_RECORD_LENGTH); lei.readFully(_value); }
public void read( LittleEndianByteArrayInputStream lei ) { _data1 = lei.readInt(); _data2 = lei.readShort(); _data3 = lei.readShort(); _data4 = lei.readLong(); } }
public void read( LittleEndianByteArrayInputStream lei ) { field_1_wReserved = lei.readShort(); field_2_scale = lei.readByte(); field_3_sign = lei.readByte(); field_4_hi32 = lei.readInt(); field_5_lo64 = lei.readLong(); } }
void read( LittleEndianByteArrayInputStream lei ) { _type = lei.readInt(); long numDimensionsUnsigned = lei.readUInt(); if ( !( 1 <= numDimensionsUnsigned && numDimensionsUnsigned <= 31 ) ) { String msg = "Array dimension number "+numDimensionsUnsigned+" is not in [1; 31] range"; throw new IllegalPropertySetDataException(msg); } int numDimensions = (int) numDimensionsUnsigned; _dimensions = new ArrayDimension[numDimensions]; for ( int i = 0; i < numDimensions; i++ ) { ArrayDimension ad = new ArrayDimension(); ad.read(lei); _dimensions[i] = ad; } }
public void read(LittleEndianByteArrayInputStream lei) { final int length = lei.readInt(); final int unicodeBytes = length*2; _value = IOUtils.safelyAllocate(unicodeBytes, MAX_RECORD_LENGTH); // If Length is zero, this field MUST be zero bytes in length. If Length is // nonzero, this field MUST be a null-terminated array of 16-bit Unicode characters, followed by // zero padding to a multiple of 4 bytes. The string represented by this field SHOULD NOT // contain embedded or additional trailing null characters. if (length == 0) { return; } final int offset = lei.getReadIndex(); lei.readFully(_value); if (_value[unicodeBytes-2] != 0 || _value[unicodeBytes-1] != 0) { String msg = "UnicodeString started at offset #" + offset + " is not NULL-terminated"; throw new IllegalPropertySetDataException(msg); } TypedPropertyValue.skipPadding(lei); }
public void read( LittleEndianByteArrayInputStream lei ) { int offset = lei.getReadIndex(); int size = lei.readInt(); _value = IOUtils.safelyAllocate(size, MAX_RECORD_LENGTH); if (size == 0) { return; } // If Size is zero, this field MUST be zero bytes in length. If Size is // nonzero and the CodePage property set's CodePage property has the value CP_WINUNICODE // (0x04B0), then the value MUST be a null-terminated array of 16-bit Unicode characters, // followed by zero padding to a multiple of 4 bytes. If Size is nonzero and the property set's // CodePage property has any other value, it MUST be a null-terminated array of 8-bit characters // from the code page identified by the CodePage property, followed by zero padding to a // multiple of 4 bytes. The string represented by this field MAY contain embedded or additional // trailing null characters and an OLEPS implementation MUST be able to handle such strings. lei.readFully(_value); if (_value[size - 1] != 0 ) { // TODO Some files, such as TestVisioWithCodepage.vsd, are currently // triggering this for values that don't look like codepages // See Bug #52258 for details String msg = "CodePageString started at offset #" + offset + " is not NULL-terminated"; LOG.log(POILogger.WARN, msg); } TypedPropertyValue.skipPadding(lei); }
public long readUInt() { return readInt() & 0x00FFFFFFFFL; }
void read( LittleEndianByteArrayInputStream lei ) { _size = lei.readUInt(); _indexOffset = lei.readInt(); } }
public void read( LittleEndianByteArrayInputStream lei ) { int offset = lei.getReadIndex(); int size = lei.readInt(); if ( size < 4 ) { String msg = "ClipboardData at offset "+offset+" size less than 4 bytes "+ "(doesn't even have format field!). Setting to format == 0 and hope for the best"; LOG.log( POILogger.WARN, msg); _format = 0; _value = new byte[0]; return; } _format = lei.readInt(); _value = IOUtils.safelyAllocate(size - LittleEndianConsts.INT_SIZE, MAX_RECORD_LENGTH); lei.readFully(_value); }
public void read( LittleEndianByteArrayInputStream lei ) { _data1 = lei.readInt(); _data2 = lei.readShort(); _data3 = lei.readShort(); _data4 = lei.readLong(); } }
public void read( LittleEndianByteArrayInputStream lei ) { field_1_wReserved = lei.readShort(); field_2_scale = lei.readByte(); field_3_sign = lei.readByte(); field_4_hi32 = lei.readInt(); field_5_lo64 = lei.readLong(); } }
void read( LittleEndianByteArrayInputStream lei ) { _type = lei.readInt(); long numDimensionsUnsigned = lei.readUInt(); if ( !( 1 <= numDimensionsUnsigned && numDimensionsUnsigned <= 31 ) ) { String msg = "Array dimension number "+numDimensionsUnsigned+" is not in [1; 31] range"; throw new IllegalPropertySetDataException(msg); } int numDimensions = (int) numDimensionsUnsigned; _dimensions = new ArrayDimension[numDimensions]; for ( int i = 0; i < numDimensions; i++ ) { ArrayDimension ad = new ArrayDimension(); ad.read(lei); _dimensions[i] = ad; } }
/** * Read the record bytes and initialize the internal variables */ private void read(final LittleEndianByteArrayInputStream leis) { final int mask = leis.readInt(); numLevels = readIf(leis, mask, C_LEVELS); defaultTabSize = readIf(leis, mask, DEFAULT_TAB_SIZE); if (TAB_STOPS.isSet(mask)) { tabStops.addAll(HSLFTabStopPropCollection.readTabStops(leis)); } for (int i=0; i<5; i++) { leftMargin[i] = readIf(leis, mask, LEFT_MARGIN[i]); indent[i] = readIf(leis, mask, INDENT[i]); } }
public TextSpecInfoRun(LittleEndianByteArrayInputStream source) { length = source.readInt(); mask = source.readInt(); if (spellFld.isSet(mask)) { spellInfo = source.readShort(); } if (langFld.isSet(mask)) { langId = source.readShort(); } if (altLangFld.isSet(mask)) { altLangId = source.readShort(); } if (bidiFld.isSet(mask)) { bidi = source.readShort(); } if (pp10extFld.isSet(mask)) { pp10extMask = source.readInt(); } if (smartTagFld.isSet(mask)) { // An unsigned integer specifies the count of items in rgSmartTagIndex. int count = source.readInt(); smartTagsBytes = IOUtils.safelyAllocate(4+count*4, MAX_RECORD_LENGTH); LittleEndian.putInt(smartTagsBytes, 0, count); // An array of SmartTagIndex that specifies the indices. // The count of items in the array is specified by count. source.readFully(smartTagsBytes, 4, count*4); } }
public void read(LittleEndianByteArrayInputStream lei) { final int length = lei.readInt(); final int unicodeBytes = length*2; _value = IOUtils.safelyAllocate(unicodeBytes, MAX_RECORD_LENGTH); // If Length is zero, this field MUST be zero bytes in length. If Length is // nonzero, this field MUST be a null-terminated array of 16-bit Unicode characters, followed by // zero padding to a multiple of 4 bytes. The string represented by this field SHOULD NOT // contain embedded or additional trailing null characters. if (length == 0) { return; } final int offset = lei.getReadIndex(); lei.readFully(_value); if (_value[unicodeBytes-2] != 0 || _value[unicodeBytes-1] != 0) { String msg = "UnicodeString started at offset #" + offset + " is not NULL-terminated"; throw new IllegalPropertySetDataException(msg); } TypedPropertyValue.skipPadding(lei); }
public void read( LittleEndianByteArrayInputStream lei ) { int offset = lei.getReadIndex(); int size = lei.readInt(); _value = IOUtils.safelyAllocate(size, MAX_RECORD_LENGTH); if (size == 0) { return; } // If Size is zero, this field MUST be zero bytes in length. If Size is // nonzero and the CodePage property set's CodePage property has the value CP_WINUNICODE // (0x04B0), then the value MUST be a null-terminated array of 16-bit Unicode characters, // followed by zero padding to a multiple of 4 bytes. If Size is nonzero and the property set's // CodePage property has any other value, it MUST be a null-terminated array of 8-bit characters // from the code page identified by the CodePage property, followed by zero padding to a // multiple of 4 bytes. The string represented by this field MAY contain embedded or additional // trailing null characters and an OLEPS implementation MUST be able to handle such strings. lei.readFully(_value); if (_value[size - 1] != 0 ) { // TODO Some files, such as TestVisioWithCodepage.vsd, are currently // triggering this for values that don't look like codepages // See Bug #52258 for details String msg = "CodePageString started at offset #" + offset + " is not NULL-terminated"; LOG.log(POILogger.WARN, msg); } TypedPropertyValue.skipPadding(lei); }