Results 1 to 4 of 4

Thread: Error?

  1. #1
    dudejonne is offline Member
    Join Date
    Oct 2009
    Posts
    56
    Rep Power
    0

    Thumbs down Error?

    What does this error mean:
    Java Code:
    C:\server>javac image.java
    image.java:199: cannot find symbol
    symbol  : method write(java.awt.image.BufferedImage)
    location: class java.io.OutputStream
    outs.write(bimg);
    This is the code:
    Java Code:
    URL u = new URL("http://localhost/image/handle.php");
    HttpURLConnection outt = (HttpURLConnection) u.openConnection();
    outt.setRequestMethod("POST");
    outt.setDoOutput(true);
    outt.setDoInput(true);
    outt.setRequestProperty("Content-Type", "image/png");
    //outt.setRequestProperty("Content-Length", Integer.toString(bimg.length));
    outt.connect();
    OutputStream outs = outt.getOutputStream();
    outs.write(bimg);
    outs.flush();
    outs.close();
    note that bimg is a bufferedImage.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    C:\server>javac image.java
    image.java:199: cannot find symbol

    Something wasn't found at line 199 in class image.

    symbol : method write(java.awt.image.BufferedImage)

    The method write(java.awt.image.BufferedImage) wasn't found in class:
    location: class java.io.OutputStream

    Offending code:
    outs.write(bimg);

    So there is no method OutputStream.write(java.awt.image.BufferedImage)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    dudejonne is offline Member
    Join Date
    Oct 2009
    Posts
    56
    Rep Power
    0

    Default

    outs.write(bimg); is line 199. So there is the problem, but the problem isn't that there is no OutputStream.write(java.awt.image.BufferedImage) because outs.write(bimg) is that! So there is something wrong with it? But I don't know what.

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Of course there is something wrong! That's why you get that error.
    Show me the method write(BufferedImage)in here:
    OutputStream (Java 2 Platform SE 5.0)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. Replies: 1
    Last Post: 10-26-2009, 05:38 PM
  2. Replies: 3
    Last Post: 01-23-2009, 09:53 AM
  3. error 530 error authentication required
    By rgale in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-12-2008, 05:28 PM

Posting Permissions

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