/[classpath]/classpath/java/util/zip/ZipFile.java
ViewVC logotype

Diff of /classpath/java/util/zip/ZipFile.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16.2.5 by gnu_andrew, Tue Aug 2 20:12:35 2005 UTC revision 1.16.2.6 by gnu_andrew, Sat Sep 10 15:31:47 2005 UTC
# Line 48  import java.io.File; Line 48  import java.io.File;
48  import java.io.IOException;  import java.io.IOException;
49  import java.io.InputStream;  import java.io.InputStream;
50  import java.io.RandomAccessFile;  import java.io.RandomAccessFile;
51    import java.io.UnsupportedEncodingException;
52  import java.util.Enumeration;  import java.util.Enumeration;
53  import java.util.HashMap;  import java.util.HashMap;
54  import java.util.Iterator;  import java.util.Iterator;
# Line 284  public class ZipFile implements ZipConst Line 285  public class ZipFile implements ZipConst
285            buffer = new byte[needBuffer];            buffer = new byte[needBuffer];
286    
287          raf.readFully(buffer, 0, nameLen);          raf.readFully(buffer, 0, nameLen);
288          String name = new String(buffer, 0, 0, nameLen);          String name;
289            try
290              {
291                name = new String(buffer, 0, nameLen, "UTF-8");
292              }
293            catch (UnsupportedEncodingException uee)
294              {
295                throw new AssertionError(uee);
296              }
297    
298          ZipEntry entry = new ZipEntry(name);          ZipEntry entry = new ZipEntry(name);
299          entry.setMethod(method);          entry.setMethod(method);
# Line 301  public class ZipFile implements ZipConst Line 310  public class ZipFile implements ZipConst
310          if (commentLen > 0)          if (commentLen > 0)
311            {            {
312              raf.readFully(buffer, 0, commentLen);              raf.readFully(buffer, 0, commentLen);
313              entry.setComment(new String(buffer, 0, commentLen));              try
314                  {
315                    entry.setComment(new String(buffer, 0, commentLen, "UTF-8"));
316                  }
317                catch (UnsupportedEncodingException uee)
318                  {
319                    throw new AssertionError(uee);
320                  }
321            }            }
322          entry.offset = offset;          entry.offset = offset;
323          entries.put(name, entry);          entries.put(name, entry);
# Line 317  public class ZipFile implements ZipConst Line 333  public class ZipFile implements ZipConst
333     */     */
334    public void close() throws IOException    public void close() throws IOException
335    {    {
336        RandomAccessFile raf = this.raf;
337        if (raf == null)
338          return;
339    
340      synchronized (raf)      synchronized (raf)
341        {        {
342          closed = true;          closed = true;

Legend:
Removed from v.1.16.2.5  
changed lines
  Added in v.1.16.2.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26