LoadFrom() публичный статический Метод

Loads a byte buffer from a stream (the first 4 bytes in the stream are the length of the data). Depending on the required capacity, either a SingleChunkBuffer or a MultiChunkBuffer will be created.
stream
public static LoadFrom ( Stream stream ) : IByteBuffer
stream Stream The stream.
Результат IByteBuffer
Пример #1
0
        /// <summary>
        /// Creates a BsonReader for a BSON Stream.
        /// </summary>
        /// <param name="stream">The BSON Stream.</param>
        /// <param name="settings">Optional reader settings.</param>
        /// <returns>A BsonReader.</returns>
        public static BsonReader Create(Stream stream, BsonBinaryReaderSettings settings)
        {
            var byteBuffer = ByteBufferFactory.LoadFrom(stream);

            byteBuffer.MakeReadOnly();
            return(new BsonBinaryReader(new BsonBuffer(byteBuffer, true), true, settings));
        }