Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to read a gsm file in java

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I need to read a gsm file from a path and store it in a database.Is it possible to read and get a gsm file in a variable?

Thanks.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is easy enough to read lots of different files, as long as you have access to the format they are in. I am sure you know it already, but there are reminders in the Java Tutorials. It depends whether it is text-based or binary; I am not familiar with gsm files myself.
For entering into a database, if you go through the JDBC forum, somebody said earlier this week you should create a .sql file and call that from the database for better performance.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of the gsm extension in particular, a Google says that there are three different types of files that have the same extension.

But no matter which file it is, there should be no problem in reading/writing it.

[Edit: Campbell beat me on that ]
[ October 10, 2008: Message edited by: Amit Ghorpade ]
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies.I can able to read.But can i able to save a gsm file in a variable like String voice="hello.gsm" ?Is this possible?
Coz if i need to store it in database ,I need to keep the gsm file only in String variable.Isn't it?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't say what kind of file this is, but I'm assuming that it is a binary file, not a text file. So you can't keep it in a string (unless you want to use base-64 encoding or some such), but instead you need to use a byte[]. The corresponding DB type would be a BLOB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic