Exemplo 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);
Exemplo 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);
Exemplo 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);
Exemplo 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);
Exemplo 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);
Exemplo 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);
Exemplo 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);
Exemplo 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));
 }
Exemplo n.º 9
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 torrent, InfoHash infohash) DecodeTorrent(RawReader reader)
 {
     return(BEncodeDecoder.DecodeTorrent(reader));
 }
Exemplo 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));
 }