请问是什么问题呢? File f = new File("new.txt"); try{ FileOutputStream fos = new FileOutputStream(f); //输出流 Byte[] bu = "www.baidu.com".getBytes(); //Type mismatch: cannot convert from byte[] to Byte[] fos.write(bu); //The method write(int) in the type FileOutputStream is not applicable for the arguments (Byte[]) fos.close(); }catch(Exception e){ e.printStackTrace(); }
try{ FileInputStream fis = new FileInputStream(f); //输入流. Byte[] buf = new Byte[1024]; int len = fis.read(); System.out.println(new String(buf,0,len)); //The constructor String(Byte[], int, int) is undefined }catch(Exception e){ e.printStackTrace(); }问题补充: