Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes Read a music file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Read a music file" Watch "Read a music file" New topic

Read a music file

Mike Brooks

Joined: Oct 07, 2007
Posts: 14

I have a program that is sending files using sockets. My question is how go I could about reading/scanning a music file to send and then recreate the file at the other end.

Thanks and Regards
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Just read it and send it one byte at a time, just like any other file. It may be a music file to something which can play music, but to a socket it's just an array of bytes.
Mike Brooks

Joined: Oct 07, 2007
Posts: 14

In my code here i get an error at the line

Just wondering if i doing something wrong

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46345
Tell us more details. What sort of error? Compiler or run-time? What is the error message or stack trace? People can only help if they know such details.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Do you really have a directory called "sdcard" in your file system root?
I agree. Here's the link:
subject: Read a music file
It's not a secret anymore!