return (new String (lin, 0, lg));
lg在退出时多加了1,所以应改为:
  return (new String (lin, 0, --lg));
就对了~~~:)