def get_counter(data, base):
b0 = data[base]<EOL>b1 = data[base + <NUM_LIT:1>]<EOL>b2 = data[base + <NUM_LIT:2>]<EOL>b3 = data[base + <NUM_LIT:3>]<EOL>counter = b3<EOL>position = (b1 << <NUM_LIT:8>) + b2<EOL>return counter, position<EOL>
See setCounters() / getCounters() methods in IJ source, ij/gui/PointRoi.java.