Show / Hide Table of Contents

Class MultiCodec

Wraps other formats with a tiny bit of self-description.

Inheritance
Object
MultiCodec
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
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 Source

ReadMultiCodec(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.

| Improve this Doc View Source

ReadMultiCodec(Stream)

Reads a Codec from the 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.

| Improve this Doc View Source

WriteMultiCodec(Stream, String)

Writes a Codec to the Stream.

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

Writes the Varint of the Code to the stream.

Exceptions
Type Condition
KeyNotFoundException

When name is not registered.

See Also

https://github.com/multiformats/multicodec
Codec
  • Improve this Doc
  • View Source
Back to top Generated by DocFX