use of org.glassfish.grizzly.Buffer in project Payara by payara.
the class WSTCPProtocolFinder method find.
@Override
public Result find(final PUContext puContext, final FilterChainContext filterChainContext) {
final Buffer buffer = filterChainContext.getMessage();
if (buffer.remaining() < PROTOCOL_SCHEMA_BYTES.length) {
return Result.NEED_MORE_DATA;
}
final int pos = buffer.position();
for (int i = 0; i < PROTOCOL_SCHEMA_BYTES.length; i++) {
if (buffer.get(pos + i) != PROTOCOL_SCHEMA_BYTES[i]) {
return Result.NOT_FOUND;
}
}
return Result.FOUND;
}
Aggregations