// No more room, so finish the last file with padding as needed
if (last.remaining() >= 3 * SEGMENT_SIZE) {
// Add a padding entry to avoid problems during reopening
last.put(createTarHeader(
PADDING_UUID,
last.remaining() - 3 * SEGMENT_SIZE));
if (last.remaining() > 2 * SEGMENT_SIZE) {
last.putLong(PADDING_MAGIC);
last.put(PADDING_BYTES, 0, SEGMENT_SIZE - 8);
}
}