【发布时间】:2016-03-17 11:02:38
【问题描述】:
我有代码并收到上面显示的错误。但是这个类被定义为抽象的,所以我不需要代码体。
public abstract class Endian
{
public short ToInt16(byte[] value, int startIndex)
{
return unchecked((short)FromBytes(value, startIndex, 2));
}
public int ToInt32(byte[] value, int startIndex)
{
return unchecked((int)FromBytes(value, startIndex, 4));
}
public long ToInt64(byte[] value, int startIndex)
{
return FromBytes(value, startIndex, 8);
}
// This same method can be used by int16, int32 and int64.
protected virtual long FromBytes(byte[] buffer, int startIndex, int len); // << Error here
}
【问题讨论】:
标签: c#