@Test
public void testHeaderCrcLongKeyWithDirectBuffer() throws KeyTypeNotImplementedException
{

  String randomValue = RngUtils.randomString(20);
  ByteBuffer directBuffer = ByteBuffer.allocateDirect(5000).order(_eventV1Factory.getByteOrder());
  DbusEventInfo eventInfo = new DbusEventInfo(DbusOpcode.UPSERT, 0L, (short)0, partitionId, timeStamp, srcId,
                                              schemaId, randomValue.getBytes(Charset.defaultCharset()), false, false);
  eventInfo.setEventSerializationVersion(DbusEventFactory.DBUS_EVENT_V1);  // make this explicit
  DbusEventFactory.serializeEvent(new DbusEventKey(key), directBuffer, eventInfo);
  DbusEventInternalReadable e = null;
  try
  {
    e = DbusEventFactoryForTesting.createReadOnlyDbusEventFromBuffer(directBuffer, 0, 200L,
                                                                     DbusEventFactory.DBUS_EVENT_V2);
  }
  catch (Exception e1)
  {
    fail("Not supposed to throw exception");
  }
  assertTrue(e.isValid());
}