@@ -14,6 +14,12 @@ public class Blob : GitObject
14
14
{
15
15
private readonly Repository repo ;
16
16
17
+ /// <summary>
18
+ /// Needed for mocking purposes.
19
+ /// </summary>
20
+ protected Blob ( )
21
+ { }
22
+
17
23
internal Blob ( Repository repo , ObjectId id )
18
24
: base ( id )
19
25
{
@@ -23,12 +29,12 @@ internal Blob(Repository repo, ObjectId id)
23
29
/// <summary>
24
30
/// Gets the size in bytes of the contents of a blob
25
31
/// </summary>
26
- public int Size { get ; set ; }
32
+ public virtual int Size { get ; set ; }
27
33
28
34
/// <summary>
29
35
/// Gets the blob content in a <see cref="byte" /> array.
30
36
/// </summary>
31
- public byte [ ] Content
37
+ public virtual byte [ ] Content
32
38
{
33
39
get
34
40
{
@@ -44,7 +50,7 @@ public byte[] Content
44
50
/// <summary>
45
51
/// Gets the blob content in a <see cref="Stream" />.
46
52
/// </summary>
47
- public Stream ContentStream
53
+ public virtual Stream ContentStream
48
54
{
49
55
get
50
56
{
@@ -59,24 +65,6 @@ public Stream ContentStream
59
65
}
60
66
}
61
67
62
- /// <summary>
63
- /// Gets the blob content decoded as UTF-8.
64
- /// </summary>
65
- /// <returns></returns>
66
- public string ContentAsUtf8 ( )
67
- {
68
- return Encoding . UTF8 . GetString ( Content ) ;
69
- }
70
-
71
- /// <summary>
72
- /// Gets the blob content decoded as Unicode.
73
- /// </summary>
74
- /// <returns></returns>
75
- public string ContentAsUnicode ( )
76
- {
77
- return Encoding . Unicode . GetString ( Content ) ;
78
- }
79
-
80
68
internal static Blob BuildFromPtr ( GitObjectSafeHandle obj , ObjectId id , Repository repo )
81
69
{
82
70
var blob = new Blob ( repo , id )
0 commit comments