2023-06-05 19:57:17 +08:00
|
|
|
|
using System;
|
2023-06-29 14:57:11 +08:00
|
|
|
|
|
2023-06-05 19:57:17 +08:00
|
|
|
|
namespace BITKit.IO
|
|
|
|
|
{
|
|
|
|
|
public record BITAsset : IAsset
|
|
|
|
|
{
|
|
|
|
|
public BITAsset() { }
|
|
|
|
|
public BITAsset(string name) {
|
|
|
|
|
this.Name = name;
|
|
|
|
|
}
|
|
|
|
|
public BITAsset(string name,string str) {
|
|
|
|
|
this.Name = name;
|
|
|
|
|
Buffer=StringHelper.GetBytes(str);
|
|
|
|
|
}
|
|
|
|
|
public BITAsset(string name, byte[] bytes) {
|
|
|
|
|
this.Name = name;
|
|
|
|
|
this.Buffer = bytes;
|
|
|
|
|
}
|
|
|
|
|
public BITAsset(byte[] buffer)
|
|
|
|
|
{
|
|
|
|
|
this.Name = Guid.NewGuid().ToString();
|
|
|
|
|
this.Buffer=buffer;
|
|
|
|
|
}
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public byte[] Buffer { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|