public int getLength() { return(TransferUtil.getLengthOfBoolean() + TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfShort() + TransferUtil.getLengthOfChar() + TransferUtil.getLengthOfInt() + TransferUtil.getLengthOfLong() + TransferUtil.getLengthOfFloat() + TransferUtil.getLengthOfDouble() + TransferUtil.getLengthOfDate() + TransferUtil.getLengthOfString(allTypeBean.getAstring())); }
public static int getByteArrayLength(Dictionary <String, DateTime> dateMap) { int blength = 0; foreach (KeyValuePair <String, DateTime> item in dateMap) { // type blength += TransferUtil.getLengthOfByte(); // key String key = item.Key; blength += TransferUtil.getLengthOfString(key); // value blength += TransferUtil.getLengthOfDate(); } return(blength); }
private int getByteArrayLength() { int blength = 0; // length of class, method, returnType and compress flag blength += TransferUtil.getLengthOfString(calleeClass); blength += TransferUtil.getLengthOfString(calleeMethod); blength += TransferUtil.getLengthOfByte(); blength += TransferUtil.getLengthOfByte(); // length of list data foreach (ValueObject vo in paramList) { if (vo.dataType == DATATYPE_BOOLEAN) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfBoolean(); } else if (vo.dataType == DATATYPE_BYTE) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfByte(); } else if (vo.dataType == DATATYPE_SHORT) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfShort(); } else if (vo.dataType == DATATYPE_CHAR) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfChar(); } else if (vo.dataType == DATATYPE_INT) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfInt(); } else if (vo.dataType == DATATYPE_LONG) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfLong(); } else if (vo.dataType == DATATYPE_FLOAT) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfFloat(); } else if (vo.dataType == DATATYPE_DOUBLE) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfDouble(); } else if (vo.dataType == DATATYPE_DATE) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfDate(); } else if (vo.dataType == DATATYPE_STRING) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfString((string)vo.dataObject); } else if (vo.dataType == DATATYPE_BYTEARRAY) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfByteArray((byte[])vo.dataObject); } else if (vo.dataType == DATATYPE_INTARRAY) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfIntArray((int[])vo.dataObject); } else if (vo.dataType == DATATYPE_LONGARRAY) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfLongArray((long[])vo.dataObject); } else if (vo.dataType == DATATYPE_FLOATARRAY) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfFloatArray((float[])vo.dataObject); } else if (vo.dataType == DATATYPE_DOUBLEARRAY) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfDoubleArray((double[])vo.dataObject); } else if (vo.dataType == DATATYPE_STRINGARRAY) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfStringArray((string[])vo.dataObject); } else if (vo.dataType == DATATYPE_WRAPPER) { blength += TransferUtil.getLengthOfByte() + TransferUtil.getLengthOfWrapper((TransferObjectWrapper)vo.dataObject); } } return(blength); }