CryptoAPIDocumentOutputStream bos = new CryptoAPIDocumentOutputStream(this); // NOSONAR byte buf[] = new byte[8]; bos.write(buf, 0, 8); // skip header List<StreamDescriptorEntry> descList = new ArrayList<>(); descEntry.streamOffset = bos.size(); descEntry.streamName = entry.getName(); descEntry.flags = StreamDescriptorEntry.flagStream.setValue(0, 1); descEntry.reserved2 = 0; bos.setBlock(block); DocumentInputStream dis = dir.createDocumentInputStream(entry); IOUtils.copy(dis, bos); dis.close(); descEntry.streamSize = bos.size() - descEntry.streamOffset; descList.add(descEntry); int streamDescriptorArrayOffset = bos.size(); bos.setBlock(0); LittleEndian.putUInt(buf, 0, descList.size()); bos.write(buf, 0, 4); bos.write(buf, 0, 4); LittleEndian.putUInt(buf, 0, sde.streamSize); bos.write(buf, 0, 4); LittleEndian.putUShort(buf, 0, sde.block);
CryptoAPIDocumentOutputStream bos = new CryptoAPIDocumentOutputStream(this); // NOSONAR byte buf[] = new byte[8]; bos.write(buf, 0, 8); // skip header List<StreamDescriptorEntry> descList = new ArrayList<>(); descEntry.streamOffset = bos.size(); descEntry.streamName = entry.getName(); descEntry.flags = StreamDescriptorEntry.flagStream.setValue(0, 1); descEntry.reserved2 = 0; bos.setBlock(block); DocumentInputStream dis = dir.createDocumentInputStream(entry); IOUtils.copy(dis, bos); dis.close(); descEntry.streamSize = bos.size() - descEntry.streamOffset; descList.add(descEntry); int streamDescriptorArrayOffset = bos.size(); bos.setBlock(0); LittleEndian.putUInt(buf, 0, descList.size()); bos.write(buf, 0, 4); bos.write(buf, 0, 4); LittleEndian.putUInt(buf, 0, sde.streamSize); bos.write(buf, 0, 4); LittleEndian.putUShort(buf, 0, sde.block);