code: public static int indexOf(ByteBuf buffer, int fromIndex, int toIndex, byte value) {
          if (fromIndex <= toIndex) {
              return firstIndexOf(buffer, fromIndex, toIndex, value);
          } else {
              return lastIndexOf(buffer, fromIndex, toIndex, value);
          }
      }
docs: The default implementation of {@link ByteBuf#indexOf(int, int, byte)}.
  This method is useful when implementing a new buffer type.