cs_catherine87
Messages postés12Date d'inscriptionlundi 22 mars 2010StatutMembreDernière intervention 8 juin 2010
-
8 juin 2010 à 13:16
cs_catherine87
Messages postés12Date d'inscriptionlundi 22 mars 2010StatutMembreDernière intervention 8 juin 2010
-
8 juin 2010 à 13:17
bonjour ,
je suis débutente en java et j'ai trouvé ce programme qui permet de recuperer le flux video d'une camera IP de type AXIS mais je n'arrive pas à comprendre exactement le role de cette boucle :
public void readLine(DataInputStream dis) {
int index = 1;
try {
do {
int length = 0;
int r;
for (int i 0; i < ((index 1) ? 4 : 5); i++) {
String line = dis.readLine();
System.out.println( index + " : $$$$ " + line);
public void readLine(int n, DataInputStream dis) {
readLine(dis);
}
public void readLine(DataInputStream dis) {
int index = 1;
try {
do {
int length = 0;
int r;
for (int i 0; i < ((index 1) ? 4 : 5); i++) {
String line = dis.readLine();
System.out.println( index + " : $$$$ " + line);
String string = "Content-Length:";
if (line.contains(string)) {
String trim = line.substring(string.length()).trim();
System.out.println(trim);
length = Integer.parseInt(trim);
}
}
byte[] aux = new byte[1000000];
int total = 0;
while (total < length) {
r = dis.read(aux, total, length - total);
total = total + r;
}