• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert audio file into bytes

 
Gaurav Aggarwall
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the FileInputStream class to read any file into a byte array.
 
Gaurav Aggarwall
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic