File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes how to read a gsm file in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to read a gsm file in java" Watch "how to read a gsm file in java" New topic

how to read a gsm file in java

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518

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?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46320
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

Joined: Jun 06, 2007
Posts: 2851

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 ]

|Asking Good Questions|
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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

Joined: Mar 22, 2005
Posts: 42965
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.
I agree. Here's the link:
subject: how to read a gsm file in java
It's not a secret anymore!