001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.osm.pbf; 003 004import jakarta.annotation.Nonnull; 005import jakarta.annotation.Nullable; 006 007/** 008 * A "BlobHeader" which contains metadata for a {@link Blob}. 009 * @since 18695 010 */ 011public final class BlobHeader { 012 private final String type; 013 private final byte[] indexData; 014 private final int dataSize; 015 016 /** 017 * Create a new {@link BlobHeader} 018 * @param type The type of data in the blob 019 * @param indexData The metadata for the blob 020 * @param dataSize The size of the blob 021 */ 022 public BlobHeader(@Nonnull String type, @Nullable byte[] indexData, int dataSize) { 023 this.type = type; 024 this.indexData = indexData; 025 this.dataSize = dataSize; 026 } 027 028 /** 029 * Get the blob type 030 * @return The blob type 031 */ 032 public String type() { 033 return this.type; 034 } 035 036 /** 037 * Get the blob metadata 038 * @return The blob metadata 039 */ 040 public byte[] indexData() { 041 return this.indexData; 042 } 043 044 /** 045 * Get the blob size 046 * @return The blob size 047 */ 048 public int dataSize() { 049 return this.dataSize; 050 } 051}