path = LittleEndian.getByteArray(data, offset, byteLength, MAX_RECORD_LENGTH); offset += byteLength; _unused = LittleEndian.getByteArray(data, offset, (charType + 1), MAX_RECORD_LENGTH);
Currency( byte[] data, int offset ) { _value = LittleEndian.getByteArray( data, offset, SIZE ); } }
Date( byte[] data, int offset ) { _value = LittleEndian.getByteArray( data, offset, SIZE ); } }
Date( byte[] data, int offset ) { _value = LittleEndian.getByteArray( data, offset, SIZE ); } }
Currency( byte[] data, int offset ) { _value = LittleEndian.getByteArray( data, offset, SIZE ); } }
Blob( byte[] data, int offset ) { int size = LittleEndian.getInt( data, offset ); if ( size == 0 ) { _value = new byte[0]; return; } _value = LittleEndian.getByteArray( data, offset + LittleEndian.INT_SIZE, size ); }
Blob( byte[] data, int offset ) { int size = LittleEndian.getInt( data, offset ); if ( size == 0 ) { _value = new byte[0]; return; } _value = LittleEndian.getByteArray( data, offset + LittleEndian.INT_SIZE, size ); }
public DocumentProperties( byte[] tableStream, int offset, int length ) { super.fillFields( tableStream, offset ); final int supportedSize = DOPAbstractType.getSize(); if ( length != supportedSize ) { this._preserved = LittleEndian.getByteArray( tableStream, offset + supportedSize, length - supportedSize, MAX_RECORD_LENGTH ); } else { _preserved = new byte[0]; } }
public DocumentProperties( byte[] tableStream, int offset, int length ) { super.fillFields( tableStream, offset ); final int supportedSize = DOPAbstractType.getSize(); if ( length != supportedSize ) { this._preserved = LittleEndian.getByteArray( tableStream, offset + supportedSize, length - supportedSize ); } else { _preserved = new byte[0]; } }
UnicodeString( byte[] data, int offset ) { int length = LittleEndian.getInt( data, offset ); if ( length == 0 ) { _value = new byte[0]; return; } _value = LittleEndian.getByteArray( data, offset + LittleEndian.INT_SIZE, length * 2 ); if ( _value[length * 2 - 1] != 0 || _value[length * 2 - 2] != 0 ) throw new IllegalPropertySetDataException( "UnicodeString started at offset #" + offset + " is not NULL-terminated" ); }
UnicodeString( byte[] data, int offset ) { int length = LittleEndian.getInt( data, offset ); if ( length == 0 ) { _value = new byte[0]; return; } _value = LittleEndian.getByteArray( data, offset + LittleEndian.INT_SIZE, length * 2 ); if ( _value[length * 2 - 1] != 0 || _value[length * 2 - 2] != 0 ) throw new IllegalPropertySetDataException( "UnicodeString started at offset #" + offset + " is not NULL-terminated" ); }
CodePageString( final byte[] data, final int startOffset ) { int offset = startOffset; int size = LittleEndian.getInt( data, offset ); offset += LittleEndian.INT_SIZE; _value = LittleEndian.getByteArray( data, offset, size ); 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 logger.log(POILogger.WARN, "CodePageString started at offset #" + offset + " is not NULL-terminated" ); // throw new IllegalPropertySetDataException( // "CodePageString started at offset #" + offset // + " is not NULL-terminated" ); } }
CodePageString( final byte[] data, final int startOffset ) { int offset = startOffset; int size = LittleEndian.getInt( data, offset ); offset += LittleEndian.INT_SIZE; _value = LittleEndian.getByteArray( data, offset, size ); 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 logger.log(POILogger.WARN, "CodePageString started at offset #" + offset + " is not NULL-terminated" ); // throw new IllegalPropertySetDataException( // "CodePageString started at offset #" + offset // + " is not NULL-terminated" ); } }
protected ComplexFileTable(byte[] documentStream, byte[] tableStream, int offset, int fcMin, Charset charset) throws IOException { //skips through the prms before we reach the piece table. These contain data //for actual fast saved files List<SprmBuffer> sprmBuffers = new LinkedList<>(); while (tableStream[offset] == GRPPRL_TYPE) { offset++; int size = LittleEndian.getShort(tableStream, offset); offset += LittleEndian.SHORT_SIZE; byte[] bs = LittleEndian.getByteArray(tableStream, offset, size, MAX_RECORD_LENGTH); offset += size; SprmBuffer sprmBuffer = new SprmBuffer(bs, false, 0); sprmBuffers.add(sprmBuffer); } this._grpprls = sprmBuffers.toArray(new SprmBuffer[sprmBuffers.size()]); if (tableStream[offset] != TEXT_PIECE_TABLE_TYPE) { throw new IOException("The text piece table is corrupted"); } int pieceTableSize = LittleEndian.getInt(tableStream, ++offset); offset += LittleEndian.INT_SIZE; _tpt = newTextPieceTable(documentStream, tableStream, offset, pieceTableSize, fcMin, charset); }
ClipboardData( byte[] data, int offset ) { int size = LittleEndian.getInt( data, offset ); if ( size < 4 ) { logger.log( POILogger.WARN, "ClipboardData at offset ", Integer.valueOf( offset ), " size less than 4 bytes " + "(doesn't even have format field!). " + "Setting to format == 0 and hope for the best" ); _format = 0; _value = new byte[0]; return; } _format = LittleEndian.getInt( data, offset + LittleEndian.INT_SIZE ); _value = LittleEndian.getByteArray( data, offset + LittleEndian.INT_SIZE * 2, size - LittleEndian.INT_SIZE ); }
public ComplexFileTable(byte[] documentStream, byte[] tableStream, int offset, int fcMin) throws IOException { //skips through the prms before we reach the piece table. These contain data //for actual fast saved files List<SprmBuffer> sprmBuffers = new LinkedList<SprmBuffer>(); while ( tableStream[offset] == GRPPRL_TYPE ) { offset++; int size = LittleEndian.getShort( tableStream, offset ); offset += LittleEndian.SHORT_SIZE; byte[] bs = LittleEndian.getByteArray( tableStream, offset, size ); offset += size; SprmBuffer sprmBuffer = new SprmBuffer( bs, false, 0 ); sprmBuffers.add( sprmBuffer ); } this._grpprls = sprmBuffers.toArray( new SprmBuffer[sprmBuffers.size()] ); if(tableStream[offset] != TEXT_PIECE_TABLE_TYPE) { throw new IOException("The text piece table is corrupted"); } int pieceTableSize = LittleEndian.getInt(tableStream, ++offset); offset += LittleEndian.INT_SIZE; _tpt = new TextPieceTable(documentStream, tableStream, offset, pieceTableSize, fcMin); }
ClipboardData( byte[] data, int offset ) { int size = LittleEndian.getInt( data, offset ); if ( size < 4 ) { logger.log( POILogger.WARN, "ClipboardData at offset ", Integer.valueOf( offset ), " size less than 4 bytes " + "(doesn't even have format field!). " + "Setting to format == 0 and hope for the best" ); _format = 0; _value = new byte[0]; return; } _format = LittleEndian.getInt( data, offset + LittleEndian.INT_SIZE ); _value = LittleEndian.getByteArray( data, offset + LittleEndian.INT_SIZE * 2, size - LittleEndian.INT_SIZE ); }
public SSSlideInfoAtom(byte[] source, int offset, int len) { int ofs = offset; // Sanity Checking if(len != 24) len = 24; assert(source.length >= offset+len); // Get the header _header = LittleEndian.getByteArray(source,ofs,8); ofs += _header.length; assert(LittleEndian.getShort(_header, 0) == 0); assert(LittleEndian.getShort(_header, 2) == RecordTypes.SSSlideInfoAtom.typeID); assert(LittleEndian.getShort(_header, 4) == 0x10); assert(LittleEndian.getShort(_header, 6) == 0); _slideTime = LittleEndian.getInt(source, ofs); assert(0 <= _slideTime && _slideTime <= 86399000); ofs += LittleEndianConsts.INT_SIZE; _soundIdRef = LittleEndian.getInt(source, ofs); ofs += LittleEndianConsts.INT_SIZE; _effectDirection = LittleEndian.getUByte(source, ofs); ofs += LittleEndianConsts.BYTE_SIZE; _effectType = LittleEndian.getUByte(source, ofs); ofs += LittleEndianConsts.BYTE_SIZE; _effectTransitionFlags = LittleEndian.getShort(source, ofs); ofs += LittleEndianConsts.SHORT_SIZE; _speed = LittleEndian.getUByte(source, ofs); ofs += LittleEndianConsts.BYTE_SIZE; _unused = LittleEndian.getByteArray(source,ofs,3); }
protected void fillFields( byte[] data, int offset ) { field_1_iStartAt = LittleEndian.getInt( data, 0x0 + offset ); field_2_nfc = data[ 0x4 + offset ]; field_3_info = data[ 0x5 + offset ]; field_4_rgbxchNums = LittleEndian.getByteArray( data, 0x6 + offset,9 ); field_5_ixchFollow = data[ 0xf + offset ]; field_6_dxaIndentSav = LittleEndian.getInt( data, 0x10 + offset ); field_7_unused2 = LittleEndian.getInt( data, 0x14 + offset ); field_8_cbGrpprlChpx = LittleEndian.getUByte( data, 0x18 + offset ); field_9_cbGrpprlPapx = LittleEndian.getUByte( data, 0x19 + offset ); field_10_ilvlRestartLim = LittleEndian.getUByte( data, 0x1a + offset ); field_11_grfhic = new Grfhic( data, 0x1b + offset ); }
protected void fillFields( byte[] data, int offset ) { field_1_iStartAt = LittleEndian.getInt( data, 0x0 + offset ); field_2_nfc = data[ 0x4 + offset ]; field_3_info = data[ 0x5 + offset ]; field_4_rgbxchNums = LittleEndian.getByteArray( data, 0x6 + offset,9 ); field_5_ixchFollow = data[ 0xf + offset ]; field_6_dxaIndentSav = LittleEndian.getInt( data, 0x10 + offset ); field_7_unused2 = LittleEndian.getInt( data, 0x14 + offset ); field_8_cbGrpprlChpx = LittleEndian.getUByte( data, 0x18 + offset ); field_9_cbGrpprlPapx = LittleEndian.getUByte( data, 0x19 + offset ); field_10_ilvlRestartLim = LittleEndian.getUByte( data, 0x1a + offset ); field_11_grfhic = new Grfhic( data, 0x1b + offset ); }