add a method for get left bytes count in the buffer.