private static Func<byte[]> LoadDataFromReader(ObjectReader reader) { return () => { var bytes = new byte[reader.Size]; reader.Load(stream => stream.Read(bytes, 0, bytes.Length)); return bytes; }; }
private static Blob CreateBlob(string id, ObjectReader reader) { return new Blob(id, reader.Size, LoadDataFromReader(reader)); }