package transport; import java.io.File; import java.io.FileInputStream; import java.net.InetAddress; import impl.GBNTSender; public class FileSender { public static void main(String[] var0) throws Exception { int var1 = 0; switch(var0.length) { case 6: var1 = Integer.parseInt(var0[5]); case 5: String var6 = var0[0]; int var2 = Integer.parseInt(var0[1]); String var3 = var0[2]; int var4 = Integer.parseInt(var0[3]); String var5 = var0[4]; //Class var7 = ClassLoader.getSystemClassLoader().loadClass(var6); Class var7 = GBNTSender.class; Sender var8 = (Sender)var7.newInstance(); var8.setErrorPercentage((double)var1); var8.connect(var2, InetAddress.getByName(var3), var4); File var9 = new File(var5); try { FileInputStream var10 = new FileInputStream(var9); byte[] var11 = new byte[4000]; int var12; int var14; while((var12 = var10.read(var11)) != -1) { for(int var13 = 0; var12 > 0; var13 += var14) { var14 = var8.send(var11, var13, var12); var12 -= var14; } } var10.close(); } catch (Exception var15) { var15.printStackTrace(); } var8.close(); var8.disconnect(); return; default: System.err.println("Usage: FileSender [error%]"); } } }