@@ -28,16 +28,14 @@ public final class Blob implements Serializable {
2828
2929 private final ByteString byteString ;
3030 private final int subtype ;
31- private final boolean isBson ;
3231
33- private Blob (ByteString byteString , int subtype , boolean isBson ) {
32+ private Blob (ByteString byteString , int subtype ) {
3433 if (subtype < 0 || subtype > 255 ) {
3534 throw new IllegalArgumentException (
3635 "The subtype for Blob must be a value in the inclusive [0, 255] range." );
3736 }
3837 this .byteString = byteString ;
3938 this .subtype = subtype ;
40- this .isBson = isBson ;
4139 }
4240
4341 /**
@@ -49,7 +47,7 @@ private Blob(ByteString byteString, int subtype, boolean isBson) {
4947 */
5048 @ Nonnull
5149 public static Blob fromByteString (@ Nonnull ByteString byteString ) {
52- return new Blob (byteString , 0 , false );
50+ return new Blob (byteString , 0 );
5351 }
5452
5553 /**
@@ -61,7 +59,7 @@ public static Blob fromByteString(@Nonnull ByteString byteString) {
6159 */
6260 @ Nonnull
6361 public static Blob fromBytes (@ Nonnull byte [] bytes ) {
64- return new Blob (ByteString .copyFrom (bytes ), 0 , false );
62+ return new Blob (ByteString .copyFrom (bytes ), 0 );
6563 }
6664
6765 /**
@@ -73,7 +71,7 @@ public static Blob fromBytes(@Nonnull byte[] bytes) {
7371 */
7472 @ Nonnull
7573 public static Blob createBsonBinary (@ Nonnull byte [] bytes ) {
76- return new Blob (ByteString .copyFrom (bytes ), 0 , true );
74+ return new Blob (ByteString .copyFrom (bytes ), 0 );
7775 }
7876
7977 /**
@@ -85,7 +83,7 @@ public static Blob createBsonBinary(@Nonnull byte[] bytes) {
8583 */
8684 @ Nonnull
8785 public static Blob createBsonBinary (@ Nonnull ByteString data ) {
88- return new Blob (data , 0 , true );
86+ return new Blob (data , 0 );
8987 }
9088
9189 /**
@@ -98,7 +96,7 @@ public static Blob createBsonBinary(@Nonnull ByteString data) {
9896 */
9997 @ Nonnull
10098 public static Blob createBsonBinary (int subtype , @ Nonnull byte [] bytes ) {
101- return new Blob (ByteString .copyFrom (bytes ), subtype , true );
99+ return new Blob (ByteString .copyFrom (bytes ), subtype );
102100 }
103101
104102 /**
@@ -111,7 +109,7 @@ public static Blob createBsonBinary(int subtype, @Nonnull byte[] bytes) {
111109 */
112110 @ Nonnull
113111 public static Blob createBsonBinary (int subtype , @ Nonnull ByteString data ) {
114- return new Blob (data , subtype , true );
112+ return new Blob (data , subtype );
115113 }
116114
117115 /**
@@ -144,15 +142,6 @@ public int subtype() {
144142 return this .subtype ;
145143 }
146144
147- /**
148- * Returns whether this Blob represents a BSON binary data type.
149- *
150- * @return True if BSON representation, false if native representation.
151- */
152- public boolean isBson () {
153- return this .isBson ;
154- }
155-
156145 /**
157146 * Returns true if this Blob is equal to the provided object.
158147 *
@@ -194,6 +183,6 @@ public String toString() {
194183 + this .byteString .size ()
195184 + ")" ;
196185 }
197- return "Blob{subtype=" + this .subtype + ", isBson=" + this . isBson + ", data=" + dataStr + "}" ;
186+ return "Blob{subtype=" + this .subtype + ", data=" + dataStr + "}" ;
198187 }
199188}
0 commit comments