File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change 2727import java .util .Arrays ;
2828
2929/**
30- generic binary holder
30+ * generic binary holder
3131 */
3232public class Binary implements Serializable {
3333
3434 private static final long serialVersionUID = 7902997490338209467L ;
3535
3636 /**
3737 * Creates a Binary object with the default binary type of 0
38+ *
3839 * @param data raw data
3940 */
40- public Binary ( byte [] data ) {
41+ public Binary (byte [] data ) {
4142 this (BSON .B_GENERAL , data );
4243 }
4344
4445 /**
4546 * Creates a Binary object
47+ *
4648 * @param type type of the field as encoded in BSON
4749 * @param data raw data
4850 */
49- public Binary ( byte type , byte [] data ) {
51+ public Binary (byte type , byte [] data ) {
5052 _type = type ;
5153 _data = data ;
5254 }
5355
54- public byte getType (){
56+ public byte getType () {
5557 return _type ;
5658 }
5759
58- public byte [] getData (){
60+ public byte [] getData () {
5961 return _data ;
6062 }
6163
62- public int length (){
64+ public int length () {
6365 return _data .length ;
6466 }
6567
6668 @ Override
6769 public boolean equals (Object o ) {
68- if (this == o ) return true ;
69- if (!(o instanceof Binary )) return false ;
70+ if (this == o ) {
71+ return true ;
72+ }
73+ if (!(o instanceof Binary )) {
74+ return false ;
75+ }
7076
7177 Binary binary = (Binary ) o ;
7278
73- if (_type != binary ._type ) return false ;
74- if (!Arrays .equals (_data , binary ._data )) return false ;
79+ if (_type != binary ._type ) {
80+ return false ;
81+ }
82+ if (!Arrays .equals (_data , binary ._data )) {
83+ return false ;
84+ }
7585
7686 return true ;
7787 }
You can’t perform that action at this time.
0 commit comments