public boolean writeNextPart(byte[] data) throws JPlagException {
  if (remainingBytes < data.length) {
    throw new JPlagException("uploadException","More data sent " + "than expected!","");
  }
  try {
    FileOutputStream out=new FileOutputStream(file,true);
    out.write(data);
    out.close();
    remainingBytes-=data.length;
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw new JPlagException("uploadException","Unable to save " + "submission part on the server!","Server out of disk space??");
  }
  return remainingBytes == 0;
}

public boolean writeNextPart ( byte [ ] data ) throws JPlagException { if ( remainingBytes < data . length ) { throw new JPlagException ( "uploadException" , "More data sent " + "than expected!" , "" ) ; } try { FileOutputStream out = new FileOutputStream ( file , true ) ; out . write ( data ) ; out . close ( ) ; remainingBytes -= data . length ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new JPlagException ( "uploadException" , "Unable to save " + "submission part on the server!" , "Server out of disk space??" ) ; } return remainingBytes == 0 ; }
writes the next part of the related file
