Skip to content

Instantly share code, notes, and snippets.

@java-MagicWang
Last active December 14, 2015 04:18

Revisions

  1. java-MagicWang renamed this gist Oct 10, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. java-MagicWang revised this gist Oct 10, 2013. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions gistTest
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    public void download(String url, String fileURL) {
    try {
    URL website = new URL(url);
    ReadableByteChannel rbc = Channels.newChannel(website.openStream());
    FileOutputStream fos = new FileOutputStream(fileURL);
    fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    public void download(String url, String fileURL) {
    try {
    URL website = new URL(url);
    ReadableByteChannel rbc = Channels.newChannel(website.openStream());
    FileOutputStream fos = new FileOutputStream(fileURL);
    fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
  3. java-MagicWang revised this gist Oct 10, 2013. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions gistTest
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,10 @@
    public class Test {

    }
    public void download(String url, String fileURL) {
    try {
    URL website = new URL(url);
    ReadableByteChannel rbc = Channels.newChannel(website.openStream());
    FileOutputStream fos = new FileOutputStream(fileURL);
    fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
  4. java-MagicWang renamed this gist Feb 25, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. java-MagicWang created this gist Feb 25, 2013.
    3 changes: 3 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    public class Test {

    }