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 maps data blength += BooleanMapHelper.getByteArrayLength(booleanMap); blength += ByteMapHelper.getByteArrayLength(byteMap); blength += ShortMapHelper.getByteArrayLength(shortMap); blength += CharMapHelper.getByteArrayLength(charMap); blength += IntMapHelper.getByteArrayLength(intMap); blength += LongMapHelper.getByteArrayLength(longMap); blength += FloatMapHelper.getByteArrayLength(floatMap); blength += DoubleMapHelper.getByteArrayLength(doubleMap); blength += DateMapHelper.getByteArrayLength(dateMap); blength += StringMapHelper.getByteArrayLength(stringMap); blength += WrapperMapHelper.getByteArrayLength(wrapperMap); blength += ByteArrayMapHelper.getByteArrayLength(byteArrayMap); blength += IntArrayMapHelper.getByteArrayLength(intArrayMap); blength += LongArrayMapHelper.getByteArrayLength(longArrayMap); blength += FloatArrayMapHelper.getByteArrayLength(floatArrayMap); blength += DoubleArrayMapHelper.getByteArrayLength(doubleArrayMap); blength += StringArrayMapHelper.getByteArrayLength(stringArrayMap); return(blength); }
public override byte[] getByteData() { int blength = getByteArrayLength(); byte[] byteArray = new byte[TransferUtil.getLengthOfInt() + blength]; TransferOutputStream touts = new TransferOutputStream(byteArray); touts.writeInt(blength); touts.writeString(calleeClass); touts.writeString(calleeMethod); touts.writeByte(returnType); touts.writeBoolean(compress); BooleanMapHelper.getByteArray(booleanMap, touts); ByteMapHelper.getByteArray(byteMap, touts); ShortMapHelper.getByteArray(shortMap, touts); CharMapHelper.getByteArray(charMap, touts); IntMapHelper.getByteArray(intMap, touts); LongMapHelper.getByteArray(longMap, touts); FloatMapHelper.getByteArray(floatMap, touts); DoubleMapHelper.getByteArray(doubleMap, touts); DateMapHelper.getByteArray(dateMap, touts); StringMapHelper.getByteArray(stringMap, touts); WrapperMapHelper.getByteArray(wrapperMap, touts); ByteArrayMapHelper.getByteArray(byteArrayMap, touts); IntArrayMapHelper.getByteArray(intArrayMap, touts); LongArrayMapHelper.getByteArray(longArrayMap, touts); FloatArrayMapHelper.getByteArray(floatArrayMap, touts); DoubleArrayMapHelper.getByteArray(doubleArrayMap, touts); StringArrayMapHelper.getByteArray(stringArrayMap, touts); return(byteArray); }