boolean isPlain = Biff8DecryptingStream.isNeverEncryptedRecord(sid); os.setNextRecordSize(len, isPlain); os.writePlain(tmp, 0, 4); if (sid == BoundSheetRecord.sid) { os.writePlain(bsrBuf, 0, 4); os.write(bsrBuf, 4, len-4); } else { plain.readFully(tmp, 0, nextLen); if (isPlain) { os.writePlain(tmp, 0, nextLen); } else { os.write(tmp, 0, nextLen);
private void encryptBytes(byte[] plain, int encryptOffset, OutputStream bos) throws IOException { try { EncryptionInfo ei = getEncryptionInfo(); Encryptor enc = ei.getEncryptor(); enc.setChunkSize(RC4_REKEYING_INTERVAL); ChunkedCipherOutputStream os = enc.getDataStream(bos, 0); if (encryptOffset > 0) { os.writePlain(plain, 0, encryptOffset); } os.write(plain, encryptOffset, plain.length-encryptOffset); os.close(); } catch (GeneralSecurityException e) { throw new IOException(e); } }
boolean isPlain = Biff8DecryptingStream.isNeverEncryptedRecord(sid); os.setNextRecordSize(len, isPlain); os.writePlain(tmp, 0, 4); if (sid == BoundSheetRecord.sid) { os.writePlain(bsrBuf, 0, 4); os.write(bsrBuf, 4, len-4); } else { plain.readFully(tmp, 0, nextLen); if (isPlain) { os.writePlain(tmp, 0, nextLen); } else { os.write(tmp, 0, nextLen);