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

//间谐波的幅值和频率结构
public class tagInHarmData
{
	public int Val;
	public int f;

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

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

		int iStep = nHaveRead;

		Val = Service.convertInt32_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Integer.SIZE / Byte.SIZE;
		f = 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)Val, Service.enum_Value_type.Value_int);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Integer)f, Service.enum_Value_type.Value_int);

		return GetSize();
	}
}