Are you assuming that every string with a leading 1 is negative? Would 13 have to be represented as "01101"? Or have you got a fixed size of 4 bits? More details required, basically.
Use if (i >= k) i -= 2 * k; Where k is the smallest positive number your scheme cannot represent. (8 in this case, because 0111 is 7 and 1000 would be negative.)
13 is greater than 8, so you'd subtract 16 from 13, giving -3.
Long res = Long.parseLong(bin, 2); if (bin.charAt(0)=='1' && bin.length()==n) res -= (1L<<n);