CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Reading Files

  1. #1
    Join Date
    Aug 1999
    Posts
    6

    Reading Files

    Hi
    I was trying to read a .jpg file and writing it into some another file. But the file contents differed. When I tried to find out what went wrong i found that all the characters with values 128 and more are written char 63. What is the problem. How can i overcome this.
    Actually i am reading one byte at a time and storing in a stringbuffer. when the size becomes 4096 i will write the buffer by getting the bytes in it.

    Please help

    Kiran Kumar B.



  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: Reading Files

    U can't use strings to store byte array.

    If u want to do binary transfer either from file to file, or computer to computer. U should use byte and not strings.

    JPG is considered binary file, as it can contain anything (in one byte).

    Instead use byte array with 4096 size.

    - UnicMan
    http://members.tripod.com/unicman

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured