Cannot copy file with other buffer sizes, except 1

Hi,
i'd like to copy files (txt, images, etc) , but by using the following route:
-read bytes from a file in a ByteBuffer
-use a byte array to create a String representation in binary form (ie "0101101") of the ByteBuffer
-print the string
and then the reverse:
-create a byte array from the String
-put the bytes in another ByteBuffer
-write them to the destination file
The problem is, that in the general case, this only works for ByteBuffer.allocate(1)! it works for txt files with any size, but not for image files; i have not tried for any other kind of file.
Ideas?
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
import java.math.*;
/* create the copy of a file:
* In the middle print a string with the contents of the buffer, in binary form
* and then use this string to create the copy of the picture.
public class CopyFile
  static public void main( String args[] ) throws Exception
     if (args.length<2) {
      System.err.println( "Usage: java CopyFile infile outfile" );
      System.exit( 1 );
    String infile = args[0];
    String outfile = args[1];    
    FileInputStream fin = new FileInputStream( infile );
    FileOutputStream fout = new FileOutputStream( outfile );
    FileChannel fcin = fin.getChannel();
    FileChannel fcout = fout.getChannel();
    ByteBuffer bufferSource = ByteBuffer.allocate( 1 );
    ByteBuffer bufferDest = ByteBuffer.allocate( 1 );
    byte[] barraySource;
    byte[] barrayDest;
    while (true) {
      bufferSource.clear();
      int r = fcin.read( bufferSource );
      barraySource=bufferSource.array();
      BigInteger biFrom = new BigInteger(barraySource);           
      String binary = biFrom.toString(2);
      System.out.println(binary+" | ");     
       BigInteger biTo=new BigInteger(binary,2);
       barrayDest=biTo.toByteArray();
       bufferDest.clear();
       bufferDest.put(barrayDest);
      if (r==-1) {
        break;
      bufferDest.flip();
      fcout.write(bufferDest);
}

I've changed a couple of things, but the problem remains. It is the first time i work with binary data. Can somebody give me a hint?
public class Test2
    public static void main(String[] args) throws Exception
        File fin=new File("C:\\Documents and Settings\\p3020139\\My Documents\\pic.JPG");
        File fout=new File("C:\\Documents and Settings\\p3020139\\My Documents\\piccp.JPG");
        FileInputStream fis=new FileInputStream(fin);
        FileOutputStream fos=new FileOutputStream(fout);       
        long fileSize= fin.length();
        long bytesRead=0;
        BufferedOutputStream baos=null;
        while (bytesRead<fileSize+1)
            byte[] barray=new byte[128];
            int read=fis.read(barray); 
            BigInteger biFrom = new BigInteger(barray);           
            String binary = biFrom.toString(2);
            System.out.println(binary);
            BigInteger biTo=new BigInteger(binary,2);
            byte[] bytesTo=biTo.toByteArray();
            baos=new BufferedOutputStream(fos,128);
            baos.write(bytesTo);
            bytesRead=bytesRead+read;
        fis.close();
        baos.close();
    }

Similar Messages

  • Cannot Copy File with Group Policy Preferences

    Hi,
    I am trying to use a Group Policy Preference to copy a simple text file from a network share to a folder at the root of 'C:\' on the clients. It is not happening. I created the preference in the computer section of the GPO. It is set to create, as the file
    does not already exist on the client, with the archive bit on.
    Source: \\server.domain.com\folder\fileshare\file.txt
    Destination: C:\folder
    GPResult shows the clients are getting the GPO, but it seems as if that one setting and another is not being applied. I have no idea why this isn't working when other parts of the GPO are being applied. I read
    the documentation on the Technet page, but I must have missed something.
    Any ideas why this might not be working?
    Thanks
    Jason Watkins MCSE, MCSA, MCDBA, CCNA

    > Computers" has read access. Listing the actual file name in the
    > destination is something I would have never though to do.
    ...unless the path ends with an "\", it IS a file name, so if you had
    "C:\Folder" as the target, check your C:\ drive for a file called
    "Folder" :)
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • CPU Jul-09 Installation - Error Cannot copy file from 'libjox10.so' to

    Hi All, I received this error while I was installing the last CPU on a 10.2.0.4 Oracle Instance running on a HP-UX Itanium System:
    Patch 8568398:
    Copy Action: Desctination File "/u02/app/oracle/product/10.2/Db_1/lib/libjox10.so" is not writeable.
    'oracle.rdbms, 10.2.0.4.0': Cannot copy file from 'libjox10.so' to '/u02/app/oracle/product/10.2/Db_1/lib/libjox10.so'
    I checked metalink' site with no similar results found.
    Could anybody help me?
    Should I run /usr/sbin/slibclean and remove the last patch (Patch 8568398) and then try again?
    This is the complete log...
    $ opatch version
    Invoking OPatch 10.2.0.4.7
    OPatch Version: 10.2.0.4.7
    OPatch succeeded.
    $ sqlplus /nolog
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Jul 17 16:29:29 2009
    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
    SQL> conn / as sysdba
    Connected.
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    $ lsnrctl stop
    LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 17-JUL-2009 16:32:29
    Copyright (c) 1991, 2007, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Hostname)(PORT=1521)))
    The command completed successfully
    $ emctl stop dbconsole
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    http://hostname:1158/em/console/aboutApplication
    Stopping Oracle Enterprise Manager 10g Database Control ...
    ... Stopped.
    $unzip p8534387_10204_HPUX-IA64.zip
    <...>
    $ cd 8534387
    $ opatch napply -skip_subset -skip_duplicate
    Invoking OPatch 10.2.0.4.7
    Oracle Interim Patch Installer version 10.2.0.4.7
    Copyright (c) 2009, Oracle Corporation. All rights reserved.
    UTIL session
    Oracle Home : /u02/app/oracle/product/10.2/Db_1
    Central Inventory : /u02/app/oracle/oraInventory
    from : /var/opt/oracle/oraInst.loc
    OPatch version : 10.2.0.4.7
    OUI version : 10.2.0.4.0
    OUI location : /u02/app/oracle/product/10.2/Db_1/oui
    Log file location : /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch2 009-07-17_16-38-05PM.log
    Patch history file: /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch_ history.txt
    Invoking utility "napply"
    Checking conflict among patches...
    Checking if Oracle Home has components required by patches...
    Checking skip_duplicate
    Checking skip_subset
    Checking conflicts against Oracle Home...
    OPatch continues with these patches: 7155248 7155249 7155250 7155251 7155252 7155253 7155254 7197583 7375611 7375613 7375617 7609057 7609058 8309587 8309592 8309623 8309632 8309637 8309642 8534387 8568395 8568397 8568398 8568402 8568404 8568405
    Do you want to proceed? y
    y
    User Responded with: Y
    Running prerequisite checks...
    Prerequisite check "CheckApplicable" failed.
    The details are:
    Patch 8568398:
    Copy Action: Desctination File "/u02/app/oracle/product/10.2/Db_1/lib/libjox10.so" is not writeable.
    'oracle.rdbms, 10.2.0.4.0': Cannot copy file from 'libjox10.so' to '/u02/app/oracle/product/10.2/Db_1/lib/libjox10.so'
    UtilSession failed: Prerequisite check "CheckApplicable" failed.
    $ opatch lsinventory -detail
    Invoking OPatch 10.2.0.4.7
    Oracle Interim Patch Installer version 10.2.0.4.7
    Copyright (c) 2009, Oracle Corporation. All rights reserved.
    Oracle Home : /u02/app/oracle/product/10.2/Db_1
    Central Inventory : /u02/app/oracle/oraInventory
    from : /var/opt/oracle/oraInst.loc
    OPatch version : 10.2.0.4.7
    OUI version : 10.2.0.4.0
    OUI location : /u02/app/oracle/product/10.2/Db_1/oui
    Log file location : /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch2009-07-17_17-53-30PM.log
    Patch history file: /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch_history.txt
    Lsinventory Output file location : /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/lsinv/lsinventory2009-07-17_17-53-30PM.txt
    Installed Top-level Products (2):
    Oracle Database 10g 10.2.0.1.0
    Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
    There are 2 products installed in this Oracle Home.
    Installed Products (190):
    Agent Required Support Files 10.2.0.1.0
    Agent Required Support Files Patch 10.2.0.4.0
    Assistant Common Files 10.2.0.1.0
    Assistant Common Files Patch 10.2.0.4.0
    Bali Share 1.1.18.0.0
    Buildtools Common Files 10.2.0.1.0
    Character Set Migration Utility 10.2.0.1.0
    Character Set Migration Utility Patch 10.2.0.4.0
    Database Configuration and Upgrade Assistants 10.2.0.1.0
    Database Configuration and Upgrade Assistants Patch 10.2.0.4.0
    Database SQL Scripts 10.2.0.1.0
    Database SQL Scripts Patch 10.2.0.4.0
    Database Workspace Manager 10.2.0.1.0
    Database Workspace Manager 10.2.0.4.0
    DBJAVA Required Support Files 10.2.0.1.0
    DBJAVA Required Support Files Patch 10.2.0.4.0
    Enterprise Edition Options 10.2.0.1.0
    Enterprise Manager Agent Core 10.2.0.1.0
    Enterprise Manager Agent Core Patch 10.2.0.4.0a
    Enterprise Manager Agent DB 10.2.0.1.0
    Enterprise Manager Agent DB 10.2.0.4.0
    Enterprise Manager Baseline 10.2.0.1.0
    Enterprise Manager Baseline 10.2.0.4.0
    Enterprise Manager Common Core Patch 10.2.0.4.0a
    Enterprise Manager Common Files 10.2.0.1.0
    Enterprise Manager Minimal Integration 10.2.0.1.0
    Enterprise Manager plugin Common Files 10.2.0.1.0
    Enterprise Manager plugin Common Files 10.2.0.1.0
    Enterprise Manager plugin Common Files Patch 10.2.0.4.0
    Enterprise Manager Repository Core 10.2.0.1.0
    Enterprise Manager Repository Core patch 10.2.0.4.0a
    Enterprise Manager Repository DB 10.2.0.1.0
    Enterprise Manager Repository DB 10.2.0.4.0
    Generic Connectivity Common Files 10.2.0.1.0
    Generic Connectivity Common Files Patch 10.2.0.4.0
    HAS Common Files 10.2.0.1.0
    HAS Common Files Patch 10.2.0.4.0
    HAS Files for DB 10.2.0.1.0
    HAS Files for DB Patch 10.2.0.4.0
    Installation Common Files 10.2.0.1.0
    Installation Common Files Patch 10.2.0.4.0
    Installer SDK Component 10.2.0.4.0
    iSQL*Plus 10.2.0.1.0
    iSQL*Plus 10.2.0.4.0
    Java Runtime Environment 1.4.2.14.0
    JDBC Common Files 10.2.0.1.0
    JDBC Common Files 10.2.0.4.0
    LDAP Required Support Files 10.2.0.1.0
    LDAP Required Support Files Patch 10.2.0.4.0
    OLAP SQL Scripts 10.2.0.1.0
    OLAP SQL Scripts Patch 10.2.0.4.0
    Oracle Advanced Security 10.2.0.1.0
    Oracle Advanced Security Patch 10.2.0.4.0
    Oracle Call Interface (OCI) 10.2.0.1.0
    Oracle Call Interface (OCI) Patch 10.2.0.4.0
    Oracle Clusterware RDBMS Files 10.2.0.1.0
    Oracle Clusterware RDBMS Files Patch 10.2.0.4.0
    Oracle Code Editor 1.2.1.0.0I
    Oracle Configuration Manager 10.2.7.1.0
    Oracle Containers for Java 10.2.0.1.0
    Oracle Containers for Java 10.2.0.4.0
    Oracle Core Required Support Files 10.2.0.1.0
    Oracle Core Required Support Files Patch 10.2.0.4.0
    Oracle Data Mining RDBMS Files 10.2.0.1.0
    Oracle Data Mining RDBMS Files Patch 10.2.0.4.0
    Oracle Database 10g 10.2.0.1.0
    Oracle Database 10g 10.2.0.1.0
    Oracle Database 10G 32 bit 10.1.0.2.0
    Oracle Database 10g interMedia Files 10.2.0.1.0
    Oracle Database 10g interMedia Files Patch 10.2.0.4.0
    Oracle Database 10g Patch 10.2.0.4.0
    Oracle Database 10g Patch 10.2.0.4.0
    Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
    Oracle Database User Interface 2.2.13.0.0
    Oracle Database Utilities 10.2.0.1.0
    Oracle Database Utilities Patch 10.2.0.4.0
    Oracle Display Fonts 9.0.2.0.0
    Oracle Enterprise Manager Console DB 10.2.0.1.0
    Oracle Enterprise Manager Console DB 10.2.0.4.0
    Oracle Extended Windowing Toolkit 3.4.38.0.0
    Oracle Globalization Support 10.2.0.1.0
    Oracle Globalization Support Patch 10.2.0.4.0
    Oracle Help For Java 4.2.6.1.0
    Oracle Help for the Web 1.1.10.0.0
    Oracle Ice Browser 5.2.3.6.0
    Oracle interMedia 10.2.0.1.0
    Oracle interMedia Annotator 10.2.0.1.0
    Oracle interMedia Client Option 10.2.0.1.0
    Oracle interMedia Client Option Patch 10.2.0.4.0
    Oracle interMedia Java Advanced Imaging 10.2.0.1.0
    Oracle interMedia Java Advanced Imaging Patch 10.2.0.4.0
    Oracle interMedia Locator 10.2.0.1.0
    Oracle interMedia Locator Patch 10.2.0.4.0
    Oracle interMedia Locator RDBMS Files 10.2.0.1.0
    Oracle interMedia Locator RDBMS Files Patch 10.2.0.4.0
    Oracle interMedia Patch 10.2.0.4.0
    Oracle Internet Directory Client 10.2.0.1.0
    Oracle Internet Directory Client Patch 10.2.0.4.0
    Oracle Java Client 10.2.0.1.0
    Oracle Java Client Patch 10.2.0.4.0
    Oracle JDBC Thin Driver for JDK 1.2 10.2.0.1.0
    Oracle JDBC Thin Driver for JDK 1.2 Patch 10.2.0.4.0
    Oracle JDBC Thin Driver for JDK 1.4 10.2.0.1.0
    Oracle JDBC Thin Driver for JDK 1.4 Patch 10.2.0.4.0
    Oracle JDBC/OCI Instant Client 10.2.0.1.0
    Oracle JDBC/OCI Instant Client Patch 10.2.0.4.0
    Oracle JFC Extended Windowing Toolkit 4.2.33.0.0
    Oracle JVM 10.2.0.1.0
    Oracle JVM Patch 10.2.0.4.0
    Oracle LDAP administration 10.2.0.1.0
    Oracle LDAP administration patch 10.2.0.4.0
    Oracle Locale Builder 10.2.0.1.0
    Oracle Message Gateway Common Files 10.2.0.1.0
    Oracle Message Gateway Common Files Patch 10.2.0.4.0
    Oracle Net 10.2.0.1.0
    Oracle Net Listener 10.2.0.1.0
    Oracle Net Listener Patch 10.2.0.4.0
    Oracle Net Patch 10.2.0.4.0
    Oracle Net Required Support Files 10.2.0.1.0
    Oracle Net Required Support Files Patch 10.2.0.4.0
    Oracle Net Services 10.2.0.1.0
    Oracle Notification Service 9.0.4.0.0
    Oracle Notification Service Patch 10.2.0.4.0
    Oracle OLAP 10.2.0.1.0
    Oracle OLAP API 10.2.0.1.0
    Oracle OLAP API Patch 10.2.0.4.0
    Oracle OLAP Patch 10.2.0.4.0
    Oracle OLAP RDBMS Files 10.2.0.1.0
    Oracle OLAP RDBMS Files Patch 10.2.0.4.0
    Oracle One-Off Patch Installer 10.2.0.4.0
    Oracle Partitioning 10.2.0.1.0
    Oracle Partitioning Patch 10.2.0.4.0
    Oracle Programmer 10.2.0.1.0
    Oracle RAC Required Support Files-HAS 10.2.0.1.0
    Oracle RAC Required Support Files-HAS Patch 10.2.0.4.0
    Oracle Real Application Testing 10.2.0.4.0
    Oracle Recovery Manager 10.2.0.1.0
    Oracle Recovery Manager Patch 10.2.0.4.0
    Oracle Required Support Files 32 bit 10.2.0.0.0
    Oracle Required Support Files 32 bit Patch 10.2.0.4.0
    Oracle Spatial 10.2.0.1.0
    Oracle Starter Database 10.2.0.1.0
    Oracle Starter Database Patch 10.2.0.4.0
    Oracle Text 10.2.0.1.0
    Oracle Text Patch 10.2.0.4.0
    Oracle UIX 2.1.22.0.0
    Oracle Universal Installer 10.2.0.4.0
    Oracle Wallet Manager 10.2.0.1.0
    Oracle Wallet Manager Patch 10.2.0.4.0
    Oracle XML Development Kit 10.2.0.1.0
    Oracle XML Development Kit Patch 10.2.0.4.0
    Parser Generator Required Support Files 10.2.0.1.0
    Perl Interpreter 5.8.3.0.1
    Perl Interpreter Patch 5.8.3.0.1a
    PL/SQL 10.2.0.1.0
    PL/SQL 10.2.0.4.0
    PL/SQL Embedded Gateway 10.2.0.1.0
    PL/SQL Embedded Gateway Patch 10.2.0.4.0
    Platform Required Support Files 10.2.0.1.0
    Platform Required Support Files 10.2.0.4.0
    Precompiler Common Files 10.2.0.1.0
    Precompiler Common Files Patch 10.2.0.4.0
    Precompiler Required Support Files 10.2.0.1.0
    Precompiler Required Support Files Patch 10.2.0.4.0
    RDBMS Required Support Files 10.2.0.1.0
    RDBMS Required Support Files for Instant Client 10.2.0.1.0
    RDBMS Required Support Files for Instant Client Patch 10.2.0.4.0
    RDBMS Required Support Files Patch 10.2.0.4.0
    regexp 2.1.9.0.0
    Required Support Files 10.2.0.1.0
    Sample Schema Data 10.2.0.1.0
    Sample Schema Data Patch 10.2.0.4.0
    Secure Socket Layer 10.2.0.1.0
    Secure Socket Layer Patch 10.2.0.4.0
    SQL*Plus 10.2.0.1.0
    SQL*Plus 10.2.0.4.0
    SQL*Plus Required Support Files 10.2.0.1.0
    SQL*Plus Required Support Files Patch 10.2.0.4.0
    SQLJ Runtime 10.2.0.1.0
    SQLJ Runtime Patch 10.2.0.4.0
    SSL Required Support Files for InstantClient 10.2.0.1.0
    SSL Required Support Files for InstantClient Patch 10.2.0.4.0
    Sun JDK 1.4.2.17.0
    Sun JDK extensions 9.2.0.1.0
    XDK Required Support Files 10.2.0.1.0
    XDK Required Support Files Patch 10.2.0.4.0
    XML Parser for Java 10.2.0.1.0
    XML Parser for Java Patch 10.2.0.4.0
    XML Parser for Oracle JVM 10.2.0.1.0
    XML Parser for Oracle JVM Patch 10.2.0.4.0
    There are 190 products installed in this Oracle Home.
    There are no Interim patches installed in this Oracle Home.
    OPatch succeeded.
    $
    $ more /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch_history.txt
    Date & Time : Fri Jul 17 16:02:17 GMT-03:00 2009
    Oracle Home : /u02/app/oracle/product/10.2/Db_1
    OPatch Ver. : 10.2.0.4.7
    Current Dir : /u02/app/oracle/product/10.2/Db_1
    Command : -v
    Log File : /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch2009-07-17_16-02-17PM.log
    Date & Time : Fri Jul 17 16:38:05 GMT-03:00 2009
    Oracle Home : /u02/app/oracle/product/10.2/Db_1
    OPatch Ver. : 10.2.0.4.7
    Current Dir : /home/ora10g/8534387
    Command : napply -skip_subset -skip_duplicate
    Log File : /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch2009-07-17_16-38-05PM.log
    Date & Time : Fri Jul 17 17:53:30 GMT-03:00 2009
    Oracle Home : /u02/app/oracle/product/10.2/Db_1
    OPatch Ver. : 10.2.0.4.7
    Current Dir : /home/ora10g/8534387
    Command : lsinventory -detail
    Log File : /u02/app/oracle/product/10.2/Db_1/cfgtoollogs/opatch/opatch2009-07-17_17-53-30PM.log
    $
    Please let me know if you need more info.
    Regards, and thanks in advance!
    Martin

    You were right. It was a permissions issue:
    hostname:/root# ls -ltr /u02/app/oracle/product/10.2/Db_1/lib/libjox10.so
    -r-xr-xr-x 1 ora10g oinstall 20041728 Apr 23 2008 /u02/app/oracle/product/10.2/Db_1/lib/libjox10.so
    Thanks.
    damorgan wrote:
    "is not writeable." means one of two things.
    1. It does not exist.
    2. Permissions are not set correctly.
    Determining which it is ... that is the first step.

  • Help - "Cannot copy file: Data error (Cyclic Redundancy Check)"

    Hey there,
    I'm having problems with my Zen Mosaic EZ00. Up until a few weeks ago it has been working fine however, since then, has begun to show the error message? "Cannot copy file: Data error (Cyclic Redundancy Check)" whenever I try to copy files on to it. I have tried the recovery software available and it only updated the firmware. Some files do occasionally (and very occasionally) copy but usually it shows the error message and cancels the copy.
    I would really appreciate if anyone could help me with this?
    Many thanks :smileytongue:

    sorry for the double post!
    ive just realised that my ipod isnt actually charging, its just got the orange light blinking!
    not too sure what is going on now!
    lol

  • Cannot copy file (From external HD, DVD, server) - iTunes 6

    Yesterday I've updated iTune to 6 and de facto Quicktime to 7.0.3.
    Just after this upgrade, I remark that I cannot copy files, using the finder, from external hard disk, dvd drive and network drive. During the drag, I've got the circle indicating that I can't copy.
    I can copy files only from my main hard disk to this one or others.
    (Note: With terminal applications I can copy theses files).
    Anyone else have this problems... or a explanation/solution.
    Thanks

    I reinstall iTune 6 and now everything is ok

  • Zip.ZipInputStream cannot extract files with Chinese chars in name

    Dear friends,
    Peace b upon u!
    I am trying to read a zip file (~3000 files)containing one
    or more files with Chinese, Japanese or Korean names, the
    getNextEntry method throws an IllegalArgumentException as below after extracting just ~300 files as below:-
    java.lang.IllegalArgumentException
            at java.util.zip.ZipInputStream.getUTF8String(Unknown Source)
            at java.util.zip.ZipInputStream.readLOC(Unknown Source)
            at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
            at testZipFiles.getZipFiles(testZipFiles.java:65)
            at testZipFiles.main(testZipFiles.java:18) issue:java.util.zip.ZipInputStream cannot extract files with Chinese chars in name
    Category java:classes_util_jarzip
    Plz let me know 1 of the ways which I can solve this issue.
    1)if someone has JAVA DCOMPILER plz send the SOURCE Code
    for the ZipInputStream.class to me..I need to edit it using 1 of the solutions as provided below which I googled.
    2)If there is an alternate or upgraded java.util.zip.ZipInputStream or any org.apache.tools.zip.* package which can read such files..If yes where I can download the same on net.
    3)Any other easier solution, which can let me extract all files (by excluding Chinese files thru CATCH) without the extractor process to fail altogether.
    On net I found that the only solution with this is:-
    - edit the new ZipEntry, remove the static initializer that calls
    the native methods initIDs().
    this step seems a bit scary, but it's according to the
    workaround
    to bug #4244499 (the workaround of Olive64, THU JUN 05
    01:55 P.M. 2003),
    that handles a similar bug at the ZipOutputStream.
    Now you have a ZipInputStream that supports multi-bytes
    entry names.
    to extract the zip file, using the fixed code that is offered
    above,
    create a function that gets an "encoding" string, a "destPath"
    string
    and a "sourceFile" (zipped) and does :
    ZipInputStream zipinputstream = null;
    ZipEntry zipentry;
    zipinputstream = new ZipInputStream(new FileInputStream
    (sourceFile),encoding);
    zipentry = zipinputstream.getNextEntry();
    while (zipentry != null) { //for each entry to be extracted
        String entryName = zipentry.getName();
        int n;
        FileOutputStream fileoutputstream = new FileOutputStream
    ( destPath + entryName );
        while ((n = zipinputstream.read(buf, 0, 1024)) > -1)
            fileoutputstream.write(buf, 0, n);
        fileoutputstream.close();
        zipinputstream.closeEntry();
        zipentry = zipinputstream.getNextEntry();
    }//while
    zipinputstream.close();

    Hi friend,
    We'd better to ask one question in each thread. If you have another issue, you can consider to open up a new thread in this forum.
    Now for the first question, do you mean this picture? It throws access exception in archive2.
    If so , because your extractPath is a path, not a directory.You should add +"xxx.zip". For more information, please refer to
    ZipFile.Open
    Method (String, ZipArchiveMode).
    For the second question, you can use the following code to skip the error message.
    while (true)
    try
    //do something;
    catch (Exception ex)
    { continue; }
    Good day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cannot copy file, file is in use

    Macbook pro 13 mid 2009 with Yosemite fresh install. (i have the same problem with the old MacOSX).
    When i try to copy a file, or a bunch of files, to the wdtvlivehub i have the message error "cannot copy file, the file is in use".
    I try the following:
    - in the wdtvlivehub activated the DNLA, WINDOWS and Itunes Server (and the linux).
    - try both via wifi and ethernet
    - repair permission on disk
    - deactivate the show miniatures on the mac and on the wdtvlivehub
    - drag & drop the file and cut e copy via keyboard or with the right click of the pad or mouse
    - connect the wdtvlivehub via SMB, CIFS
    - Try with AFP but i get a error message
    - with an app i search for a program that block the file but it didn't find anything
    -Basically i try everything suggest in this board and over the web but nothing resolve the problem.
    The file sometimes been copied but i have to try a billion times....not so comfort in this.
    What i have to do?
    P.S. Sorry for my bad english.

    Hi,
    We often see this file in use when the file has not been closed. Is it just a regular file that was opened and how did you open it? I use AppleScript to close it if it was opened with AppleScript.
    Edited: try this: Run Script Editor. Enter:
    set f to choose file -- select the file
    close access f
    run it in Script Editor.
    gl,
    kel

  • Getting the error "Cannot copy file GEARAspiWDM.sys." while installing iTunes

    I am installing iTunes on my PC (Windows XP) but I am getting the error "Cannot copy file GEARAspiWDM.sys." but the path is correct and I can copy it manually. Help!

    Hello LondonMom,
    Sorry to hear that iTunes is not installing properly.  I found an article that has steps for troubleshooting iTunes installation issues on a Windows computer:
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    I recommend starting with the section titled "General installation troubleshooting" and then continue with the section titled "Additional troubleshooting" if the error persists. 
    I hope this helps!
    Best,
    Sheila M.

  • Sharing files with other members of my family on the wireless network

    I would like to share my files with other members of my family on the wireless network. Unfortunately, their pcs are MS Windows OS and connected in workgroup type while I am on Mac. I can access internet via the same wireless router but cannot see other members. Can someone advise How I can accomplish it. Thanks!

    I don't have personal experience with this, but I was reading this article earlier today, and it seems to address your situation. I think the solution is on page 2.
    http://bx.businessweek.com/microsoft-vs-apple/view?url=http%3A%2F%2Fwww.computer world.com%2Faction%2Farticle.do%3Fcommand%3DviewArticleBasic%26articleId%3D91315 58
    Hope this helps.

  • Web.show_document cannot display file with Chinese char in IIS 6

    Dear all,
    There is a problem that web.show_document cannot display file with Chinese char in IIS 6, but works fine in IIS 5.
    Is it a server problem or is there any setting in server? Do you know how to solve it?
    Big Thanks
    JY

    Hi,
    As Francois mentioned, this issue has nothing to do with forms / web.show_document. web.show_document, just opens the URL specified as parameter. So, if you run the URL (that you've passed as argument for web.show_document), directly in the browser, you would be getting the same issue.
    So, as you said, if it works fine in IIS 5 and does not in IIS 6, it would be an issue with the IIS and not forms. You might want to check out the IIS 6 release notes / documentation for any known issues / raise an issue in that.
    -Arun

  • Do we need to format data and log files with 64k cluster size for sql server 2012?

    Do we need to format data and log files with 64k cluster size for sql server 2012?
    Does this best practice still applies to sql server 2012 & 2014?

    Yes.  The extent size of SQL Server data files, and the max log block size have not changed with the new versions, so the guidance should remain the same.
    Microsoft SQL Server Storage Engine PM

  • Some chart types cannot be combined with other chart types

    Good morning,
    I am working on a MacBook Air (purchased Oct 2009) running Lion. While working in Excel 2011, I encounter the error "Some chart types cannot be combined with other chart types. Please select a different chart type." I am highlighting 46 cells to create a marked line graph. There are no other charts in the file. I called Microsoft support who told me they had not heard of this problem in Excel (only in PowerPoint). I also took it to an Apple Store Genius, who was unable to solve the problem, which is understandable, given that he does not work for Microsoft.
    To try to resolve this issue, I have recopied the data to a new spreadsheet, re-typed all the data to a new spreadsheet, and deleted plist files. When I sent it to a different computer (which was running Excel 2011 and Snow Leopard), I could make the figure but I cannot edit the figure or add data on my laptop.
    Any suggestions that you have would be much appreciated,
    Signed,
    One stressed out PhD student who desperately needs Excel to work

    Hi, folks.
    Apparently, when using Excel 2011 and running Lion, if the tab names in excel contain a period (.), this error occurs. I removed the periods and now I can graph again. I hope this helps anyone else who may experience this problem.

  • Cannot copy files from CD or DVD using Finder.

    Hi,
    I cannot copy files and folders from a CD or DVD to my home folder or any folder therein using Finder. I just get the "Not Permitted" symbol next to the mouse pointer when I try to drag a folder out of the CD (or DVD) to my home folder.
    I have checked that I have sufficient permissions to perform this operation and when I copy files from the CD or DVD using the command line, it works without any hassles.
    This is extremely strange and I cannot think of why it should happen.
    A solution would be most welcome as I would prefer not to have to drop into a command line when I have to copy files from CDs or DVDs.
    Regards,
    Apurva
    Apple iBook G4   Mac OS X (10.4)  

    I am experiencing the same problem: after undoing a copy in the Finder from my CD-drive to my Seagate 200GB FW-drive, I am no longer able to copy single files in the Finder from other drives than my harddisk. I can copy from my hard disk to my external harddisk, I can move and copy files within the harddisk, but I cannot copy from my external hard drive or my CD/DVD-drive to my harddisk or from my CD/DVD-drive to my external hard drive or the internal harddisk.
    What is increasingly weird, is that I can easily copy two or more files using drag and drop! I also get a nice green + sometimes when trying to move the files, but there is just no response.
    I have tried the following:
    0) rebooted.
    1) rm com.apple.finder.plist + killall -9 Finder
    2) done that in the finder using cmd-alt-esc to kill the finder.
    3) removed cache files using Yasu from http://jimmitchelldesigns.com/yasu.html, including rebooting
    4) Doublechecked permissions, including locked bits
    5) run periodic everything from the Terminal
    6) repaired permissions
    7) checked the hard disk using disk utility
    8) Logged in as another admin user to no avail.
    I can use the Terminal to copy the files without any problems, and I can open files in other applications and save them where ever from there, but the Finder refuses to let me.
    May Gods wrath kill the Finder for good! I certainly hope 10.5 will show a new Finder!

  • Cannot copy files from my network using finder

    If I try to copy files from my NAS or my PC to my Macmini running Leopard, I cannot copy files that are larger than 64kb. Otherwise I get an error message. Interestingly, if I use the cp command in the console instead, he can copy the file, but the file is corrupt in the sense that it is smaller than the original and not working. Weirdest thing is that I can access the same files from itunes or iphoto or vlc or whatever. Any ideas?

    After the update I cannot connect to my router anymore
    (see other threat)

  • Cannot copy files direct from PC to DROID-Mini

    Have direct connection to PC (Win7x64 OS) via USB data/charge cable. I am trying to copy MP3 files to the Music folder on phone but I get "Device might not be able to play this type of file", and then "Cannot copy file." I assume this phone can play MP3 files. I was able to create a subfolder in "Music", but cannot write to it or the main "Music" folder. The main reason I upgraded to this phone was bluetooth connectivity to my Sena motorcycle bluetooth wireless headset/intercom/phone system - mostly to play music. From what I can tell from the less than detailed manual, I should be able to copy files to the phone storage from a Win7 PC. Any help appreciated.

    Easiest way I find to transfer photos/music is to use mass storage mode.
    Plug in the device, it asked for mass storage mode permission..
    Then it pretty much works for ur memory card in the device as an external harddrive/usb.
    Get access direct to move things freely between memory card and pc.
    Go to options> Media Card> Change Mass storage mode support to  ON and Auto enable mass storage mode to prompt..
    If your issue is resolved, put a checkmark in the green box that contains the resolution.
    OR
    If it was just/or also really helpful - Give it a Kudos.. Go on Mate.. Help the rest of the clueless blackberry user world find their answer too..
    ~Gday from Down Under~

Maybe you are looking for

  • "Skype Has Stopped Working" Error in Windows 7 pro...

    First of all, I'm sorry if this isn't the correct area to post this.  So Everything was fine until yesterday, When I was talking with a Friend of mine, Skype crashed & I haven't been able to use it since.  I've tried Uninstalling & Reinstalling, I lo

  • Form Field Recognition in Acrobat Professional X

    I am having problems with creating a form in Acrobat X Professional. The document (18 pages!) is scanned and saved in PDF format. 95% of the fields in the hard copy are check mark fields. The required rresponse is a check or leave blank. A typical li

  • File permission error while using vista

    HI In using vista  .I am getting file permission error in create text file.wats the reason? kavi

  • Guide lines to chosing a LCD monitor

    I am in need of a new monitor. My Trinitron CRT is giving out and would like to replace it with a LCD type and know that Adobe does not support LCD gamma adjustment. What are some of the guide lines to use for the selection of a new monitor? Does "co

  • How to position a menu on a webpage?

    Hi all, I'm a graphic designer new to web design. I'm using Dreamweaver CS5 to design a site for work. I'm using a third party D-HTML program made my So Think to create a menu. It enables me to add the menu to the webpage using Dreamweaver. (It's lik