Results 1 to 4 of 4
  1. #1
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Location
    Turkey
    Posts
    380
    Blog Entries
    24
    Rep Power
    4

    Default How can I read a jpg file from an on-line source?

    Java Code:
    					Scanner into = new Scanner
    							(new URL(http://s3.amazonaws.com/data.tumblr.com/tumblr_lxla8jWqmv1qzr53co1_1280.jpg).openStream());
    					FileOutputStream myFile = new FileOutputStream("c://test//test.jpg");
    					while(into.hasNextByte()==true)
    					{
    							myFile.write(into.nextByte());
    					}
                                            into.close();
    The file created has 0 bytes in it.

    Why can I read the bytes in this jpg file and write to test.jpg ?
    Last edited by fatabass; 01-21-2012 at 10:46 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: What am I doing wrong here?

    Quote Originally Posted by fatabass View Post
    What am I doing wrong here?
    You're using a meaningless subject header.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Location
    Turkey
    Posts
    380
    Blog Entries
    24
    Rep Power
    4

    Default Re: What am I doing wrong here?

    How can I edit the header

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: What am I doing wrong here?

    Edit Post -> Go Advanced should do it.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 4
    Last Post: 06-11-2013, 02:37 AM
  2. What is wrong?
    By phantom06 in forum New To Java
    Replies: 2
    Last Post: 02-02-2011, 07:08 PM
  3. can't see where it went wrong..
    By Yakg in forum New To Java
    Replies: 5
    Last Post: 01-31-2011, 01:19 PM
  4. Something is Wrong O.o
    By Spidermonkey in forum Advanced Java
    Replies: 16
    Last Post: 11-14-2010, 05:33 AM
  5. Please help, what am I doing wrong?
    By mmac1218 in forum New To Java
    Replies: 2
    Last Post: 09-02-2009, 12:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •