Hi Guys,
I am trying to send a file over my network, started as one file, but now many, so i need to send the file name too, this is fine, as i've sent it as a Byte, but how do i convert that byte back to a string?
so far i've got this method...
strRemote = new BufferedInputStream(skt.getInputStream());
byte[] downBuffer = new byte[2048];
try {
byte[] FileNameBytes = new byte[ strRemote.read(downBuffer)];//read the filename
FileName = new String(FileNameBytes); //this is where i'm stuck..
strLocal = new FileOutputStream(
"C:/"+FileName.toString());//+FileName);
} catch (FileNotFoundException ex ) {
System.out.println("File Name Error"+FileName);
System.exit(1);
}
which just outputs File name Error and some mess.
anyideas?