java.io.DataInputStream in=
               new DataInputStream(new StringBufferInputStream("welcome"));

解决方案 »

  1.   

    badboy_119(菜鸟) :  StringBufferInputStream is Deprecated. This class does not properly convert characters into bytes
      

  2.   

    java.io.DataInputStream in=
                   new DataInputStream(new StringBufferInputStream("welcome"));
      

  3.   

    String text="sdafasd";
    ByteArrayInputStream in=new ByteArrayInputStream(text.getBytes());
    DataInputStream din=new DataInputStream(in);虽然麻烦点,但是没有Deprecated哦