public byte[] getPacket() {
		try {
			MessageDigest md5 = MessageDigest.getInstance("MD5");
            long longLength = currentFile.length();
            int dataLength = (int) longLength;
            if (dataLength != longLength)
                throw new IOException("File size >= 2 GB");
            byte[] data = new byte[dataLength];
            currentFile.readFully(data);
            
            byte[] preamble = "FILE ".getBytes();
            byte[] checksum = md5.digest(data);
            
            byte[] filename = currentFilename.getBytes();
            if(filename.length > 255) {
            	throw new IOException("File name >= 256 Bytes");
            }
            byte filenameLength = (byte)(filename.length&0xFF);
            
            byte[] packet = new byte[checksum.length + dataLength + filenameLength + 1 + 5];
            int offset = 0;
            System.arraycopy(preamble, 0, packet, 0, 5);
            offset += 5;
            System.arraycopy(checksum, 0, packet, offset, 16);
            offset += 16;
            System.arraycopy(new byte[]{filenameLength}, 0, packet, offset, 1);
            offset += 1;
            System.arraycopy(filename, 0, packet, offset, filenameLength);
            offset += filenameLength;
            System.arraycopy(data, 0, packet, offset, data.length);
            
            return packet;
		} catch (NoSuchAlgorithmException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}