When I setPty(true), I can directly use in.available() to get the number of bytes that can be read.
When I setPty(false), I have to use in.read() first and then use i