Class MultiCodec
Wraps other formats with a tiny bit of self-description.
Inherited Members
Namespace: Ipfs
Assembly: Ipfs.Core.dll
Syntax
public static class MultiCodec
Remarks
MultiCodec is a self-describing multiformat, it wraps other formats with a tiny bit of self-description. A multicodec identifier is both a varint and the code identifying the following data.
Adds the following extension methods to Stream
- ReadMultiCodec
- WriteMultiCodec(Stream, String)
Methods
| Improve this Doc View SourceReadMultiCodec(CodedInputStream)
Reads a Codec from the Google.Protobuf.CodedInputStream.
Declaration
public static Codec ReadMultiCodec(this CodedInputStream stream)
Parameters
Type | Name | Description |
---|---|---|
Google.Protobuf.CodedInputStream | stream | A multicodec encoded Google.Protobuf.CodedInputStream. |
Returns
Type | Description |
---|---|
Codec | The codec. |
Remarks
If the code does not exist, a new Codec is registered with the Name "codec-x"; where 'x' is the code's decimal represention.
ReadMultiCodec(Stream)
Declaration
public static Codec ReadMultiCodec(this Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | A multicodec encoded Stream. |
Returns
Type | Description |
---|---|
Codec | The codec. |
Remarks
If the code does not exist, a new Codec is registered with the Name "codec-x"; where 'x' is the code's decimal represention.
WriteMultiCodec(Stream, String)
Declaration
public static void WriteMultiCodec(this Stream stream, string name)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | A multicodec encoded Stream. |
String | name | The Name. |
Remarks
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | When |