MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / writeFileRecord

Method writeFileRecord

src/main/java/io/NvStorage.java:71–102  ·  view source on GitHub ↗
(
            DataOutputStream ostream, 
            String name, int index, 
            boolean rewrite)

Source from the content-addressed store, hash-verified

69 }
70
71 static public boolean writeFileRecord (
72 DataOutputStream ostream,
73 String name, int index,
74 boolean rewrite)
75 {
76 ByteArrayOutputStream lbaos=baos;
77 baos=null; // освободим для следующего
78 byte[] b=lbaos.toByteArray();
79
80
81 try {
82 if (rewrite) RecordStore.deleteRecordStore(name);
83 } catch (Exception e) {}
84
85 RecordStore recordStore;
86 try {
87 recordStore = RecordStore.openRecordStore(name, true);
88 } catch (Exception e) { return false;}
89
90 try {
91 try {
92 recordStore.setRecord(index+1, b, 0, b.length);
93 } catch (InvalidRecordIDException e) { recordStore.addRecord(b, 0, b.length); }
94 recordStore.closeRecordStore();
95 ostream.flush();
96 ostream.close();
97 } catch (Exception e) {
98 return false;
99 }
100
101 return true;
102 }
103}

Callers 12

saveToStorageMethod · 0.95
writeSrvCacheMethod · 0.95
saveToStorageMethod · 0.95
saveToStorageMethod · 0.95
saveRecentListMethod · 0.95
rmsUpdateMethod · 0.95
rmsUpdateMethod · 0.95
rmsUpdateMethod · 0.95
saveToStorageMethod · 0.95
writeToStorageMethod · 0.95
saveToStorageMethod · 0.95
saveStatusToStorageMethod · 0.95

Calls 7

deleteRecordStoreMethod · 0.95
openRecordStoreMethod · 0.95
setRecordMethod · 0.95
addRecordMethod · 0.95
closeRecordStoreMethod · 0.95
flushMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected