Added Buffered Streams to improve performance
This commit is contained in:
parent
b8ea934e3b
commit
5b4eac8dfa
3 changed files with 6 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
@ -35,7 +36,7 @@ public class UeBehaviourFileDownload extends UeBehaviour {
|
||||||
connection.setReadTimeout(3000);
|
connection.setReadTimeout(3000);
|
||||||
connection.setUseCaches(false);
|
connection.setUseCaches(false);
|
||||||
connection.connect();
|
connection.connect();
|
||||||
InputStream in = connection.getInputStream();
|
InputStream in = new BufferedInputStream(connection.getInputStream());
|
||||||
|
|
||||||
long progress = 0;
|
long progress = 0;
|
||||||
long read = 0;
|
long read = 0;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
@ -42,7 +43,7 @@ public class UeBehaviourFtpUpload extends UeBehaviour {
|
||||||
connection.setConnectTimeout(5000);
|
connection.setConnectTimeout(5000);
|
||||||
connection.setReadTimeout(3000);
|
connection.setReadTimeout(3000);
|
||||||
connection.connect();
|
connection.connect();
|
||||||
OutputStream out = connection.getOutputStream();
|
OutputStream out = new BufferedOutputStream(connection.getOutputStream());
|
||||||
|
|
||||||
int total = 0;
|
int total = 0;
|
||||||
while(total < size && !stopExecution()){
|
while(total < size && !stopExecution()){
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
@ -79,7 +80,7 @@ public class UeBehaviourSurfing extends UeBehaviour {
|
||||||
connection.setReadTimeout(3000);
|
connection.setReadTimeout(3000);
|
||||||
connection.setUseCaches(false);
|
connection.setUseCaches(false);
|
||||||
connection.connect();
|
connection.connect();
|
||||||
InputStream in = connection.getInputStream();
|
InputStream in = new BufferedInputStream(connection.getInputStream());
|
||||||
|
|
||||||
if (estimatedDataLength < 0)
|
if (estimatedDataLength < 0)
|
||||||
estimatedDataLength = in.available();
|
estimatedDataLength = in.available();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue