Added byte[].GetSingle() and byte[].GetDouble()
ln.build - build0.waldrennach.l--n.de build job pending
Details
ln.build - build0.waldrennach.l--n.de build job pending
Details
parent
b7a64b4609
commit
8bd39c3cc3
|
@ -62,6 +62,22 @@ namespace ln.type
|
|||
}
|
||||
public static uint GetUInt(this byte[] bytes, ref int offset, Endianess endianess) => BitConverter.ToUInt32(bytes.Slice(ref offset, 4).To(endianess), 0);
|
||||
|
||||
public static byte[] GetSingle(this byte[] bytes, ref int offset, out float value) => GetSingle(bytes, ref offset, out value, Endianess.LITTLE);
|
||||
public static byte[] GetSingle(this byte[] bytes, ref int offset, out float value, Endianess endianess)
|
||||
{
|
||||
value = GetSingle(bytes, ref offset, endianess);
|
||||
return bytes;
|
||||
}
|
||||
public static float GetSingle(this byte[] bytes, ref int offset, Endianess endianess) => BitConverter.ToSingle(bytes.Slice(ref offset, 4).To(endianess), 0);
|
||||
|
||||
public static byte[] GetDouble(this byte[] bytes, ref int offset, out double value) => GetDouble(bytes, ref offset, out value, Endianess.LITTLE);
|
||||
public static byte[] GetDouble(this byte[] bytes, ref int offset, out double value, Endianess endianess)
|
||||
{
|
||||
value = GetDouble(bytes, ref offset, endianess);
|
||||
return bytes;
|
||||
}
|
||||
public static double GetDouble(this byte[] bytes, ref int offset, Endianess endianess) => BitConverter.ToDouble(bytes.Slice(ref offset, 8).To(endianess), 0);
|
||||
|
||||
|
||||
public static byte[] GetBytes(this byte[] bytes,ref int offset,int length,out byte[] value)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue