List of usage examples for io.netty.buffer ByteBufUtil indexOf
public static int indexOf(ByteBuf needle, ByteBuf haystack)
From source file:org.traccar.helper.BufferUtil.java
License:Apache License
public static int indexOf(String needle, ByteBuf haystack) { ByteBuf needleBuffer = Unpooled.wrappedBuffer(needle.getBytes(StandardCharsets.US_ASCII)); try {//w w w .j a v a 2s . c o m return ByteBufUtil.indexOf(needleBuffer, haystack); } finally { needleBuffer.release(); } }