-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from ipfs-shipyard/rel/0.2.0
Release 0.2.0; Kubo 0.26.0+ support
- Loading branch information
Showing
14 changed files
with
117 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,23 @@ | ||
using System.IO; | ||
using System.Runtime.Serialization; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Ipfs.Http | ||
{ | ||
/// <inheritdoc /> | ||
[DataContract] | ||
public class Block : IDataBlock | ||
{ | ||
long? size; | ||
|
||
/// <inheritdoc /> | ||
[DataMember] | ||
public Cid Id { get; set; } | ||
/// <summary> | ||
/// The data of the block. | ||
/// </summary> | ||
public byte[] DataBytes { get; set; } | ||
|
||
/// <inheritdoc /> | ||
[DataMember] | ||
public byte[] DataBytes { get; set; } | ||
public required Cid Id { get; set; } | ||
|
||
/// <inheritdoc /> | ||
public Stream DataStream | ||
{ | ||
get | ||
{ | ||
return new MemoryStream(DataBytes, false); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
[DataMember] | ||
public long Size | ||
{ | ||
get | ||
{ | ||
if (size.HasValue) | ||
{ | ||
return size.Value; | ||
} | ||
return DataBytes.Length; | ||
} | ||
set | ||
{ | ||
size = value; | ||
} | ||
} | ||
|
||
public required long Size { get; set; } | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.