public static ByteBuffer clearLastComponent(ByteBuffer byteBuffer, AbstractType<?> type)
{
if (type instanceof CompositeType)
{
CompositeType c = (CompositeType) type;
List<CompositeComponent> components = c.deconstruct(byteBuffer);
components.remove(components.size() - 1);
CompositeType.Builder builder = c.builder();
for (CompositeComponent cc : components)
{
builder.add(cc.value);