This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am loosing data when I send it to my client. How do I figure this? When I receive the data (music) and play it, it sounds off. Some sounds don't play correctly and sound like they are missing some data. While the general music audio lines are still hearable, it just sounds like the quality is off. When I play the songs without the transfer, they sound fine. I am guessing there is something wrong with the way I do the transfer. Small amounts of bits are being "chewed off" (sorry, I couldn't resist) and you can hear it. Please note that I tried this on my computer and on another computer through my network. They sounded the same, so it isn't my internet connection. I also tried it with "localhost". It was the same quality, poor.
EDIT : Please try this code yourself. It runs 100% fine. Just put the server in a folder, along with a file named "SongList.txt". You will need a WAV, AU, or other supported file type audio files in the server folder. "SongList.txt" should contain a list of those audio files. Here is a sample of what is in "SongList.txt" :
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
You cannot receive binary data as a String using a Reader of any kind and then convert it to bytes without some data loss. Readers interpret the data they read, making various substitutions. You must instead use an InputStream to read the raw bytes directly.