I am trying to save the zip file i am receiving from a service call . Below is the code i am trying to save it . Am not getting any error but not getting the extension .
ReadableByteChannel readableByteChannel = Channels.newChannel(url.openStream());
FileOutputStream fileOutputStream = new FileOutputStream("C:\\RandD\\IC");// not allowing
me to save as IC.zip
FileChannel fileChannel = fileOutputStream.getChannel();
fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
What is the correct way to save the zip file . Looking for most efficient way to do this.