mirror of
https://github.com/topjohnwu/jtar.git
synced 2024-11-23 03:19:41 +00:00
updated README
This commit is contained in:
parent
5ff6991e2b
commit
ac8a4c69cc
10
README.md
10
README.md
@ -22,15 +22,15 @@ Below are some examples of using jtar in applications
|
||||
TarOutputStream out = new TarOutputStream( new BufferedOutputStream( dest ) );
|
||||
|
||||
// Files to tar
|
||||
File[] filesToTar=new File\[2\];
|
||||
filesToTar\[0\]=new File("c:/test/myfile1.txt");
|
||||
filesToTar\[1\]=new File("c:/test/myfile2.txt");
|
||||
File[] filesToTar=new File[2];
|
||||
filesToTar[0]=new File("c:/test/myfile1.txt");
|
||||
filesToTar[1]=new File("c:/test/myfile2.txt");
|
||||
|
||||
for(File f:filesToTar){
|
||||
out.putNextEntry(new TarEntry(f, f.getName()));
|
||||
BufferedInputStream origin = new BufferedInputStream(new FileInputStream( f ));
|
||||
int count;
|
||||
byte data[] = new byte\[2048\];
|
||||
byte data[] = new byte[2048];
|
||||
|
||||
while((count = origin.read(data)) != -1) {
|
||||
out.write(data, 0, count);
|
||||
@ -54,7 +54,7 @@ Below are some examples of using jtar in applications
|
||||
|
||||
while((entry = tis.getNextEntry()) != null) {
|
||||
int count;
|
||||
byte data[] = new byte\[2048\];
|
||||
byte data[] = new byte[2048];
|
||||
FileOutputStream fos = new FileOutputStream(destFolder + "/" + entry.getName());
|
||||
BufferedOutputStream dest = new BufferedOutputStream(fos);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user