/*
 * Created on Nov 21, 2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package TFTPudp;
 
import java.io.Serializable;
 
/**
 * @author Danelutto Marco
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class TFTPmessage implements Serializable {
 
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
 
	/**
	 * un pacchetto ha un numero di sequenza, un payload e un indicatore che dice se ci saranno ancora pacchetti dopo questo
	 */
	int nSeq;
	byte [] buffer = null;
	boolean more = true;
 
	/**
	 * costruttore del pacchetto TFTP
	 * @param n numero di sequenza del pacchetto
	 * @param b buffer da inserire nel payload
	 * @param l lunghezza del buffer 
	 * @param m marca di prossimo pacchetto: vera se questo non e' l'ultimo pacchetto del trasferimento file
	 */
	TFTPmessage(int n, byte[] b, int l, boolean m) {
		nSeq = n;
		buffer = new byte[l]; 
		for(int i=0;i<l;i++) 
			buffer[i]=b[i];
		more = m;
	}
}