Reader.read(char[])方法测试

  Reader r = new StringReader("1234567890abcd");
  char[]  segmentBuff = new char[10];
  int count = r.read(segmentBuff);
  System.out.println(count+":"+new String(segmentBuff));

输出结果:10:1234567890

 Reader r = new StringReader("1234");
  char[]  segmentBuff = new char[10];
  int count = r.read(segmentBuff);
  System.out.println(count+":"+new String(segmentBuff));

输出结果:4:1234