/// <summary> /// Decode BEncoded data in the given stream /// </summary> /// <param name="stream">The stream containing the BEncoded data</param> /// <param name="strictDecoding"></param> /// <returns></returns> public static BEncodedValue Decode(Stream stream, bool strictDecoding) => BEncodeDecoder.Decode(stream, strictDecoding);
/// <summary> /// Decode BEncoded data in the given stream /// </summary> /// <param name="buffer"></param> /// <param name="strictDecoding"></param> /// <returns></returns> public static BEncodedValue Decode(ReadOnlySpan <byte> buffer, bool strictDecoding) => BEncodeDecoder.Decode(ref buffer, strictDecoding);
/// <summary> /// Decode BEncoded data in the given stream /// </summary> /// <param name="stream">The stream containing the BEncoded data</param> /// <returns>BEncodedValue containing the data that was in the stream</returns> public static BEncodedValue Decode(Stream stream) => BEncodeDecoder.Decode(stream, DefaultStrictDecoding);
/// <summary> /// Decode BEncoded data in the given stream /// </summary> /// <param name="stream">The stream containing the BEncoded data</param> /// <param name="strictDecoding"></param> /// <returns>BEncodedValue containing the data that was in the stream</returns> public static T Decode <T> (Stream stream, bool strictDecoding) where T : BEncodedValue => (T)BEncodeDecoder.Decode(stream, strictDecoding);
/// <summary> /// Decode BEncoded data in the given stream /// </summary> /// <param name="buffer">The byte array containing the BEncoded data</param> /// <returns></returns> public static BEncodedValue Decode(ReadOnlySpan <byte> buffer) => BEncodeDecoder.Decode(ref buffer, DefaultStrictDecoding);
/// <summary> /// Decode BEncoded data in the given stream /// </summary> /// <param name="stream">The stream containing the BEncoded data</param> /// <returns>BEncodedValue containing the data that was in the stream</returns> public static T Decode <T> (Stream stream) where T : BEncodedValue => (T)BEncodeDecoder.Decode(stream, DefaultStrictDecoding);
/// <summary> /// Decode BEncoded data in the given byte array /// </summary> /// <param name="buffer">The byte array containing the BEncoded data</param> /// <param name="strictDecoding"></param> /// <returns></returns> public static T Decode <T> (ReadOnlySpan <byte> buffer, bool strictDecoding) where T : BEncodedValue => (T)BEncodeDecoder.Decode(ref buffer, strictDecoding);
/// <summary> /// Special decoding method for torrent files - allows dictionary attributes to be out of order for the /// overall torrent file, but imposes strict rules on the info dictionary. /// </summary> /// <returns></returns> public static BEncodedDictionary DecodeTorrent(RawReader reader) { return(BEncodeDecoder.DecodeTorrent(reader)); }
/// <summary> /// Special decoding method for torrent files - allows dictionary attributes to be out of order for the /// overall torrent file, but imposes strict rules on the info dictionary. /// </summary> /// <returns></returns> public static (BEncodedDictionary torrent, InfoHash infohash) DecodeTorrent(RawReader reader) { return(BEncodeDecoder.DecodeTorrent(reader)); }
/// <summary> /// Decode BEncoded data in the given RawReader /// </summary> /// <param name="reader">The RawReader containing the BEncoded data</param> /// <returns>BEncodedValue containing the data that was in the stream</returns> public static BEncodedValue Decode(RawReader reader) { return(BEncodeDecoder.Decode(reader)); }