Java List Sum addByteToMessage(final List message, final byte bytevalue, final int checksum)

Here you can find the source of addByteToMessage(final List message, final byte bytevalue, final int checksum)

Description

Add a byte to the message, updating the checksum.

License

Open Source License

Parameter

Parameter Description
message a parameter
bytevalue a parameter
checksum a parameter

Return

int

Declaration


public static int addByteToMessage(final List<Byte> message, final byte bytevalue, final int checksum) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU General Public License as published by

import java.util.List;

public class Main {
    /***********************************************************************************************
     * Add a byte to the message, updating the checksum.
     */*from   ww  w. j  a  v  a 2s . c  o  m*/
     * @param message
     * @param bytevalue
     * @param checksum
     *
     * @return int
     */

    public static int addByteToMessage(final List<Byte> message, final byte bytevalue, final int checksum) {
        int intChecksum;

        intChecksum = checksum;

        message.add(bytevalue);
        intChecksum += bytevalue;

        return (intChecksum);
    }
}

Related

  1. adjustSumOfSquareValue(List oper, Number adjustedOper1)
  2. calculateSum(List valueList)
  3. checkSum(List stringList)
  4. getListSum(List list)