-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for OP_MSG with checksum #71
- Loading branch information
1 parent
5be8bfa
commit abb27e0
Showing
3 changed files
with
80 additions
and
26 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
core/src/main/java/de/bwaldvogel/mongo/wire/MessageFlag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.bwaldvogel.mongo.wire; | ||
|
||
public enum MessageFlag { | ||
CHECKSUM_PRESENT(0), | ||
MORE_TO_COME(1), | ||
EXHAUST_ALLOWED(16), | ||
; | ||
|
||
private final int value; | ||
|
||
MessageFlag(int bit) { | ||
this.value = 1 << bit; | ||
} | ||
|
||
public boolean isSet(int flags) { | ||
return (flags & value) == value; | ||
} | ||
|
||
public int removeFrom(int flags) { | ||
return flags - value; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters