File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Convert audio file into bytes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Convert audio file into bytes" Watch "Convert audio file into bytes" New topic
Author

Convert audio file into bytes

Gaurav Aggarwall
Greenhorn

Joined: Aug 29, 2009
Posts: 22
Hi..
i am working on a project of Audio Steganography.
I just wanted to know about how to convert an audio file into bytes..
just tell me the package and method used for this process..


SCJP 1.5
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
You can use the FileInputStream class to read any file into a byte array.


Ping & DNS - my free Android networking tools app
Gaurav Aggarwall
Greenhorn

Joined: Aug 29, 2009
Posts: 22
but i havent found any method in this class which could help me.

actually i am able to retrive the mp3 file from hard disk but i am not able to convert it into bytes and store inro an array.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
What do you mean by "I am able to retrieve the mp3 file from hard disk" - what's the code for that doing if it doesn't read the file into a byte array?

Anyway, here's code to read a file into a byte array: http://www.exampledepot.com/egs/java.io/File2ByteArray.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert audio file into bytes