Results 1 to 3 of 3
  1. #1
    salmontres is offline Member
    Join Date
    Dec 2011
    Posts
    30
    Rep Power
    0

    Default Saving an array of bytes to a file

    Hi guys,

    I'd like to save an array of bytes to a file. (It was initially a JPEG, but I resized it and now have an array of bytes.) How would I do the reverse transformation to save it to some new file? Which classes am I looking for?

    Any advice is appreciated.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: Saving an array of bytes to a file

    To save the byte to a file, see the following
    Lesson: Basic I/O (The Java™ Tutorials > Essential Classes)
    If the bytes translate to an image, depending upon how the pixels are stored you can use ImageIO.write to save the image to File
    ImageIO (Java Platform SE 6)

  3. #3
    salmontres is offline Member
    Join Date
    Dec 2011
    Posts
    30
    Rep Power
    0

    Default Re: Saving an array of bytes to a file

    That's two of my problems you've solved, doWhile... Thank you very much!

Similar Threads

  1. Array of 4 bytes to double.
    By blind melon in forum Advanced Java
    Replies: 4
    Last Post: 12-08-2010, 11:19 AM
  2. saving bytes received in different request
    By renuka_anil in forum Java Servlet
    Replies: 18
    Last Post: 12-26-2008, 12:12 PM
  3. saving bytes received in different request
    By renuka_anil in forum Advanced Java
    Replies: 3
    Last Post: 12-23-2008, 07:44 PM
  4. Replies: 7
    Last Post: 10-28-2008, 01:41 PM
  5. DES algorithm (Read and Write bytes to file)
    By JoaoPe in forum Advanced Java
    Replies: 6
    Last Post: 07-29-2008, 03:46 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
  •