• Post Reply Bookmark Topic Watch Topic
  • New Topic

Read .dsp file cont.

 
Lin Shen
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a file called input.dsp. I don't know what it is actually. As part of my project, I was given this file and need to read this file from the hard disk.

When the BufferedReader reads this file, an exception occurs. The exception says encountered character that is not the character set.

Could anybody tell me whether java.io is possible to do so. If not, what else can i try?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15715
73
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Reader and Writer classes (such as BufferedReader that you're using) are for reading and writing text files. Obviously your .dsp file is a binary file, not a text file. You can read it using an InputStream class (for example, FileInputStream).

The extension ".dsp" is not the extension of a widely used, well-known file type, so we can't tell you what that file is.

If you don't even know what the .dsp file is, how do you know what you need to do with it in your project? You need to get clear why you need to read the .dsp file and what you need to do with it - you can't write a program if you don't have any idea what it needs to do.
 
Lin Shen
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have solved the problem. There is no problem with the BufferedReader to read up the dsp file. The actual problem is that I set the type of the string that would be transferred over the Internet to string(8 byte char) in the idl file for CORBA. Actually I have to set it to wstring (16 byte char) for the content in the dsp file.

It is not neccessary for me to understand what the dsp file is for my project. I only need to read a bunch of files from the client side and save them on a server machine. And then do some stuff on these files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!