Нет. Каждый давний программист на Java имеет свой собственный сервисный пояс, который включает в себя такой метод. Вот мой.
public static void copyFileToFile(final File src, final File dest) throws IOException
{
copyInputStreamToFile(new FileInputStream(src), dest);
dest.setLastModified(src.lastModified());
}
public static void copyInputStreamToFile(final InputStream in, final File dest)
throws IOException
{
copyInputStreamToOutputStream(in, new FileOutputStream(dest));
}
public static void copyInputStreamToOutputStream(final InputStream in,
final OutputStream out) throws IOException
{
try
{
try
{
final byte[] buffer = new byte[1024];
int n;
while ((n = in.read(buffer)) != -1)
out.write(buffer, 0, n);
}
finally
{
out.close();
}
}
finally
{
in.close();
}
}