public void read( LittleEndianByteArrayInputStream lei ) { lei.readFully(_value); } }
@Override public void readPlain(byte[] buf, int off, int len) { readFully(buf, off, len); } }
public void read( LittleEndianByteArrayInputStream lei ) { lei.readFully(_value); } }
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) { 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); }
leis.readFully(clsBuf);
leis.readFully(buf, 0, nrBytes); final String str = CodePageUtil.getStringFromCodePage(buf, 0, nrBytes, cp);
lei.setReadIndex(offset); final byte[] v = IOUtils.safelyAllocate(unpadded, MAX_RECORD_LENGTH); lei.readFully( v, 0, unpadded ); throw new ReadingNotSupportedException( type, v );
lei.readFully(biBytesLE);
public void readFully(byte[] buf) { readFully(buf, 0, buf.length); } public double readDouble() {
public void readFully(byte[] buf) { readFully(buf, 0, buf.length); } public double readDouble() {
public void read( LittleEndianByteArrayInputStream lei ) { lei.readFully(_value); } }
@Override public void readPlain(byte[] buf, int off, int len) { readFully(buf, off, len); } }
public void read( LittleEndianByteArrayInputStream lei ) { lei.readFully(_value); } }
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) { 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 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); } }