Class Blob
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.pbf.Blob
-
public final class Blob extends java.lang.Object
A "Blob" of data from an OSM PBF file. It, in turn, contains additional data in PBF format, which may be compressed.- Since:
- 18695
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBlob.CompressionTypeThe compression types for the blob
-
Field Summary
Fields Modifier and Type Field Description private byte[]bytesprivate Blob.CompressionTypecompressionTypeprivate java.lang.IntegerrawSize
-
Constructor Summary
Constructors Constructor Description Blob(java.lang.Integer rawSize, Blob.CompressionType compressionType, byte... bytes)Create a new blob
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]bytes()The bytes that make up the blob dataBlob.CompressionTypecompressionType()The compression type of the blobjava.io.InputStreaminputStream()Get the decompressed inputstream for this blobjava.lang.IntegerrawSize()The raw size of the blob (after decompression)
-
-
-
Field Detail
-
rawSize
private final java.lang.Integer rawSize
-
compressionType
private final Blob.CompressionType compressionType
-
bytes
private final byte[] bytes
-
-
Constructor Detail
-
Blob
public Blob(@Nullable java.lang.Integer rawSize, @Nonnull Blob.CompressionType compressionType, @Nonnull byte... bytes)
Create a new blob- Parameters:
rawSize- The blob sizecompressionType- The compression typebytes- The bytes of the blob
-
-
Method Detail
-
rawSize
@Nullable public java.lang.Integer rawSize()
The raw size of the blob (after decompression)- Returns:
- The raw size
-
compressionType
@Nonnull public Blob.CompressionType compressionType()
The compression type of the blob- Returns:
- The compression type
-
bytes
@Nonnull public byte[] bytes()
The bytes that make up the blob data- Returns:
- The bytes
-
inputStream
@Nonnull public java.io.InputStream inputStream() throws java.io.IOException
Get the decompressed inputstream for this blob- Returns:
- The decompressed inputstream
- Throws:
java.io.IOException- if we don't support the compression type or the decompressor has issues, seeBZip2CompressorInputStream
-
-