CADI.Server
Class Util

java.lang.Object
  extended by CADI.Server.Util

public class Util
extends java.lang.Object

This class finds out the JPEG2000 parameters from the J2C headers.

Version:
0.1 2008/04/07
Author:
Group on Interactive Coding of Images (GICI)

Constructor Summary
Util()
           
 
Method Summary
static float calculateAverageWeighted(long[] bytes, long[] times)
          Calculates the average of bytes per second.
static long waitTime(long[] bytes, long[] times, long bytesToSend, float maxTxRate)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

calculateAverageWeighted

public static float calculateAverageWeighted(long[] bytes,
                                             long[] times)
Calculates the average of bytes per second. The average is weighted following a gaussian distribution.

Parameters:
bytes - is an one-dimensional array with the amount of bytes.
times - is an one-dimensional array with the time where bytes was sent. It is expressed in miliseconds. The first index is when the first dada was sent, and the last one is the most most recently time.
Returns:
the average of bytes per second.

waitTime

@Deprecated
public static long waitTime(long[] bytes,
                                       long[] times,
                                       long bytesToSend,
                                       float maxTxRate)
Deprecated. 

Parameters:
bytes -
times -
maxTxRate -
Returns:
time in milisecons


CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) (contact)