I am trying to understand some java code we are using to unzip files.
What I do not understand is the part where it
says FileOutputStream(Extract_to+"\\"+str);
What does "\\" this mean.. Why not just "\"
I am guesting that these \\ is extract_to\str
"\\" this is not an operator right?
howard
create or replace and compile java source named "myjavaunzip"
as
import java.io.*;
import java.util.*;
import java.util.zip.*;
import java.text.*;
import java.lang.*;
class myjavaunzip
{
public static void unzip(String zip_name,String Extract_to)
throws Exception
{
ZipEntry ze;
String str;
int n=0;
FileInputStream fis=new FileInputStream(zip_name);
ZipInputStream zis=new ZipInputStream(fis);
while (true)
{
ze=zis.getNextEntry();
if (ze==null)
break;
str=ze.getName();
int x = fis.available();
byte [] rgb = new byte [x];
FileOutputStream fout = new FileOutputStream(Extract_to+"\\"+str);
while((n=zis.read(rgb))>-1)
{
fout.write(rgb,0,n);
}
fout.close();
zis.closeEntry();
}
zis.close();
fis.close();
}
}
/
What I do not understand is the part where it
says FileOutputStream(Extract_to+"\\"+str);
What does "\\" this mean.. Why not just "\"
I am guesting that these \\ is extract_to\str
"\\" this is not an operator right?
howard
create or replace and compile java source named "myjavaunzip"
as
import java.io.*;
import java.util.*;
import java.util.zip.*;
import java.text.*;
import java.lang.*;
class myjavaunzip
{
public static void unzip(String zip_name,String Extract_to)
throws Exception
{
ZipEntry ze;
String str;
int n=0;
FileInputStream fis=new FileInputStream(zip_name);
ZipInputStream zis=new ZipInputStream(fis);
while (true)
{
ze=zis.getNextEntry();
if (ze==null)
break;
str=ze.getName();
int x = fis.available();
byte [] rgb = new byte [x];
FileOutputStream fout = new FileOutputStream(Extract_to+"\\"+str);
while((n=zis.read(rgb))>-1)
{
fout.write(rgb,0,n);
}
fout.close();
zis.closeEntry();
}
zis.close();
fis.close();
}
}
/