MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / readByteBlock

Method readByteBlock

src/main/java/History/HistoryLoader.java:117–139  ·  view source on GitHub ↗
(long pos)

Source from the content-addressed store, hash-verified

115 }
116
117 private void readByteBlock(long pos) {
118 FileIO f = FileIO.createConnection(fileName);
119 if (current_block == null) {
120 current_block = new char[BLOCK_SIZE];
121 }
122 try {
123 InputStreamReader is = new InputStreamReader(f.openInputStream(), "UTF-8");
124 is.skip(pos);
125 is.read(current_block);
126 is.close();
127
128 } catch (IOException e) {
129 try { f.close();
130 return;
131 } catch (IOException ex2) {/*No messages*/}
132 } catch (Exception e) { return; }
133
134 try {
135 f.close();
136 } catch (Exception e) {/*No messages*/}
137
138 current_index = pos;
139 }
140
141 private String getSubstr(int off, int length) {
142 return new String(current_block).substring(off, off + length);

Callers 1

readBlockMethod · 0.95

Calls 4

createConnectionMethod · 0.95
openInputStreamMethod · 0.95
closeMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected