Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Read .dsp file cont.

 
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?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • 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.
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!