MCPcopy Index your code
hub / github.com/facebook/SoLoader / read

Method read

java/com/facebook/soloader/MinElf.java:291–309  ·  view source on GitHub ↗
(ElfByteChannel bc, ByteBuffer bb, int sz, long offset)

Source from the content-addressed store, hash-verified

289 }
290
291 private static void read(ElfByteChannel bc, ByteBuffer bb, int sz, long offset)
292 throws IOException {
293 bb.position(0);
294 bb.limit(sz);
295
296 while (bb.remaining() > 0) {
297 int numBytesRead = bc.read(bb, offset);
298 if (numBytesRead == -1) {
299 break; // Reached end of channel
300 }
301 offset += numBytesRead;
302 }
303
304 if (bb.remaining() > 0) {
305 throw new ElfError("ELF file truncated");
306 }
307
308 bb.position(0);
309 }
310
311 private static long get64(ElfByteChannel bc, ByteBuffer bb, long offset) throws IOException {
312 read(bc, bb, 8, offset);

Callers 4

get64Method · 0.95
getu32Method · 0.95
getu16Method · 0.95
getu8Method · 0.95

Calls 2

positionMethod · 0.65
readMethod · 0.65

Tested by

no test coverage detected