Esempio n. 1
0
 /// <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);
Esempio n. 2
0
 /// <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);
Esempio n. 3
0
 /// <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);
Esempio n. 4
0
 /// <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);
Esempio n. 5
0
 /// <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);
Esempio n. 6
0
 /// <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);
Esempio n. 7
0
 /// <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);
Esempio n. 8
0
 /// <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));
 }
Esempio n. 10
0
 /// <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));
 }