Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public ResourceLocator(String resourceUrl) {
}

public ResourceLocator(ByteBuffer buffer) {
this.protocol = NanoTDFType.Protocol.values()[buffer.get()];
// Get the first byte and mask it with 0xF to keep only the first four bits
byte protocolByte = buffer.get();
int protocolIndex = protocolByte & 0xF;
this.protocol = NanoTDFType.Protocol.values()[protocolIndex];
this.bodyLength = buffer.get();
this.body = new byte[this.bodyLength];
buffer.get(this.body);
Expand Down