public void write(OutputStream out) throws IOException { byte[] header = new byte[22]; int pos = 0; LittleEndian.putInt(header, pos, APMHEADER_KEY); pos += LittleEndian.INT_SIZE; //header key LittleEndian.putUShort(header, pos, 0); pos += LittleEndian.SHORT_SIZE; //hmf LittleEndian.putUShort(header, pos, left); pos += LittleEndian.SHORT_SIZE; //left LittleEndian.putUShort(header, pos, top); pos += LittleEndian.SHORT_SIZE; //top LittleEndian.putUShort(header, pos, right); pos += LittleEndian.SHORT_SIZE; //right LittleEndian.putUShort(header, pos, bottom); pos += LittleEndian.SHORT_SIZE; //bottom LittleEndian.putUShort(header, pos, inch); pos += LittleEndian.SHORT_SIZE; //inch LittleEndian.putInt(header, pos, 0); pos += LittleEndian.INT_SIZE; //reserved checksum = getChecksum(); LittleEndian.putUShort(header, pos, checksum); out.write(header); }
@Override public void confirmPassword(String password) { int keyComp = CryptoFunctions.createXorKey1(password); int verifierComp = CryptoFunctions.createXorVerifier1(password); byte xorArray[] = CryptoFunctions.createXorArray1(password); byte shortBuf[] = new byte[2]; XOREncryptionVerifier ver = (XOREncryptionVerifier)getEncryptionInfo().getVerifier(); LittleEndian.putUShort(shortBuf, 0, keyComp); ver.setEncryptedKey(shortBuf); LittleEndian.putUShort(shortBuf, 0, verifierComp); ver.setEncryptedVerifier(shortBuf); setSecretKey(new SecretKeySpec(xorArray, "XOR")); }
LittleEndian.putUShort( ((Number)value).intValue(), out ); length = LittleEndianConsts.SHORT_SIZE;
LittleEndian.putUShort(data, 0, nChars); LittleEndian.putByte(data, 2, is16BitFlag); in.readFully(data, 3, data.length-3);
LittleEndian.putUInt(buf, 0, sde.streamSize); bos.write(buf, 0, 4); LittleEndian.putUShort(buf, 0, sde.block); bos.write(buf, 0, 2); LittleEndian.putUByte(buf, 0, (short)sde.streamName.length());
/** * A bit mask specifying options for displaying headers and footers * * @param mask A bit mask specifying options for displaying headers and footers */ public void setMask(int mask){ LittleEndian.putUShort(_recdata, 2, mask); }
public void serialize( byte[] data, int offset ) { LittleEndian.putUShort(data, 0x0 + offset, field_1_cstd); LittleEndian.putUShort(data, 0x2 + offset, field_2_cbSTDBaseInFile); LittleEndian.putUShort(data, 0x4 + offset, field_3_info3); LittleEndian.putUShort(data, 0x6 + offset, field_4_stiMaxWhenSaved); LittleEndian.putUShort(data, 0x8 + offset, field_5_istdMaxFixedWhenSaved); LittleEndian.putUShort(data, 0xa + offset, field_6_nVerBuiltInNamesWhenSaved); LittleEndian.putShort(data, 0xc + offset, field_7_ftcAsci); LittleEndian.putShort(data, 0xe + offset, field_8_ftcFE); LittleEndian.putShort(data, 0x10 + offset, field_9_ftcOther); }
/** * Create a new, empty, SlideListWithText */ public SlideListWithText(){ _header = new byte[8]; LittleEndian.putUShort(_header, 0, 15); LittleEndian.putUShort(_header, 2, (int)_type); LittleEndian.putInt(_header, 4, 0); // We have no children to start with _children = new Record[0]; slideAtomsSets = new SlideAtomsSet[0]; }
/** * Create a new SlidePersistAtom, for use with a new Slide */ public SlidePersistAtom(){ _header = new byte[8]; LittleEndian.putUShort(_header, 0, 0); LittleEndian.putUShort(_header, 2, (int)_type); LittleEndian.putInt(_header, 4, 20); hasShapesOtherThanPlaceholders = true; reservedFields = new byte[4]; }
public void serialize( byte[] data, int startOffset ) { int offset = startOffset; LittleEndian.putUShort( data, offset, _cch ); offset += LittleEndian.SHORT_SIZE; for ( char c : _rgtchar ) { LittleEndian.putShort( data, offset, (short) c ); offset += LittleEndian.SHORT_SIZE; } }
/** * Create a new instance of {@code OEPlaceholderAtom} */ public OEPlaceholderAtom(){ _header = new byte[8]; LittleEndian.putUShort(_header, 0, 0); LittleEndian.putUShort(_header, 2, (int)getRecordType()); LittleEndian.putInt(_header, 4, 8); placementId = 0; placeholderId = 0; placeholderSize = 0; }
public void serialize( byte[] data, int offset ) { LittleEndian.putShort(data, 0x0 + offset, field_1_info1); LittleEndian.putShort(data, 0x2 + offset, field_2_info2); LittleEndian.putShort(data, 0x4 + offset, field_3_info3); LittleEndian.putUShort(data, 0x6 + offset, field_4_bchUpe); LittleEndian.putShort(data, 0x8 + offset, field_5_grfstd); }
public void serialize( byte[] data, int offset ) { LittleEndian.putShort(data, 0x0 + offset, field_1_info1); LittleEndian.putShort(data, 0x2 + offset, field_2_info2); LittleEndian.putShort(data, 0x4 + offset, field_3_info3); LittleEndian.putUShort(data, 0x6 + offset, field_4_bchUpe); LittleEndian.putShort(data, 0x8 + offset, field_5_grfstd); }