File Transfer
Hey, I am trying to send a file over a socket, so far I have split the file into byte[] arrays, and sent them over the PrintWriter (as it had a method for sending byte arrays), my question is, how do I receive them?
I was originally writing and reading each byte individually on separate lines with:
[code]
String received = in.readLine();
while (!received.startsWith("T")) { //the first string sent after the bytes of the file begins with a T.
testFile.write(Integer.valueOf(received).intValue()); //this byte is written to the file.
received = in.readLine();
}[/code
Where 'in' is a BufferedReader.
I know there is a BufferedReader method for read(char[] cbuf, int off, int len) , but as far as I can tell this receives separate characters, and then places them into a byte array, how do I just receive a byte array straight from the socket?
Thank-you in advance.

