package com.njcn.csharmonic.offline.mincfg.vo;

//功率结构
public class tagPowerData
{
	public int P;
	public int Q;
	public int S;

	public static int GetSize()
	{
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		return 3 * Integer.SIZE / Byte.SIZE;
	}

	public final boolean SetStructBuf(byte[] bArray, int nHaveRead)
	{
		int nByteSize = bArray.length;
		if (nByteSize < GetSize())
		{
			return false;
		}

		int iStep = nHaveRead;

		P = Service.convertInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		Q = Service.convertInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		S = Service.convertInt32_net(bArray, iStep);

		return true;
	}

	/**
	 @brief 将类中的变量组装成byte[]二进制流
	 @return byte[] out 二进制数组

	 */
	public final int GetStructBuf(RefObject<Byte[]> bArray, int nHaveRead)
	{
		int nSize = bArray.argvalue.length;
		if (nSize < (nHaveRead + GetSize()))
		{
			return 0;
		}
		int iStep = nHaveRead;
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)P, Service.enum_Value_type.Value_int);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)Q, Service.enum_Value_type.Value_int);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)S, Service.enum_Value_type.Value_int);

		return GetSize();
	}

}