aeron-client/src/main/java/io/aeron/logbuffer/TermRebuilder.java
public static void insert(
        final UnsafeBuffer termBuffer, final int termOffset, final UnsafeBuffer packet, final int length)
    {
        if (0 == termBuffer.getInt(termOffset))
        {
            termBuffer.putBytes(termOffset + HEADER_LENGTH, packet, HEADER_LENGTH, length - HEADER_LENGTH);

            termBuffer.putLong(termOffset + 24, packet.getLong(24));
            termBuffer.putLong(termOffset + 16, packet.getLong(16));
            termBuffer.putLong(termOffset + 8, packet.getLong(8));

            termBuffer.putLongOrdered(termOffset, packet.getLong(0));
        }
    }
public static void insert(
        final UnsafeBuffer termBuffer, final int termOffset, final UnsafeBuffer packet, final int length)
    {
        if (0 == termBuffer.getInt(termOffset))
        {
            termBuffer.putBytes(termOffset + HEADER_LENGTH, packet, HEADER_LENGTH, length - HEADER_LENGTH);

            termBuffer.putLong(termOffset + 24, packet.getLong(24));
            termBuffer.putLong(termOffset + 16, packet.getLong(16));
            termBuffer.putLong(termOffset + 8, packet.getLong(8));

            termBuffer.putLongOrdered(termOffset, packet.getLong(0));
        }
    }
Insert a packet of frames into the log at the appropriate termOffset as indicated by the term termOffset header.
<p>
If the packet has already been inserted then this is a noop.

@param termBuffer into which the packet should be inserted.
@param termOffset in the term at which the packet should be inserted.
@param packet     containing a sequence of frames.
@param length     of the packet of frames in bytes.