public double get_bit(int idx, int bit) { return (dataraw[data_offset+2+idx] & (1<<bit)) != 0 ? 1 : 0; }