Hi,

I am trying to write binary file using j-interop, Below is the excerpt from the code:

wbemLocator.callMethodA("open", new Object[] {});
while (copy.input.available() > 0)
{

            len = copy.input.read(b);
                            //For write 
            Byte temp[] = new Byte[b.length];
            for(int i=0;i<b.length;i++)
            {
                temp[i] = b[i];
            }
            wbemLocator.callMethod("Write",new Object[]{new JIVariant(new JIArray(temp),JIVariant.VT_UNKNOWN)});

I am getting the below exception:

java.lang.ArrayIndexOutOfBoundsException: 3220
at jcifs.util.Encdec.enc_uint32le(Encdec.java:65)
at ndr.NdrBuffer.enc_ndr_long(NdrBuffer.java:141)
at ndr.NetworkDataRepresentation.writeUnsignedLong(NetworkDataRepresentation.java:73)
at org.jinterop.dcom.core.JIMarshalUnMarshalHelper$IntegerImpl.serializeData(JIMarshalUnMarshalHelper.java:848)
at org.jinterop.dcom.core.JIMarshalUnMarshalHelper.serialize(JIMarshalUnMarshalHelper.java:185)

Could anyone help me in this....i was struck here for 1 week.