Changeset 18698 in josm for trunk


Ignore:
Timestamp:
2023-03-21T14:21:54+01:00 (21 months ago)
Author:
taylor.smock
Message:

See r18695, #22603: Drop optional compression support

We don't include LZMA or Zstd decompressors in the dist-optimized build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/pbf/Blob.java

    r18697 r18698  
    1111
    1212import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
    13 import org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream;
    14 import org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream;
    1513
    1614/**
     
    1917 */
    2018public final class Blob {
     19    /** The compression types for the blob */
    2120    public enum CompressionType {
    2221        /** No compression */
     
    3736    private final CompressionType compressionType;
    3837    private final byte[] bytes;
     38
     39    /**
     40     * Create a new blob
     41     * @param rawSize The blob size
     42     * @param compressionType The compression type
     43     * @param bytes The bytes of the blob
     44     */
    3945    public Blob(@Nullable Integer rawSize, @Nonnull CompressionType compressionType, @Nonnull byte... bytes) {
    4046        this.rawSize = rawSize;
     
    7581     * @throws IOException if we don't support the compression type <i>or</i> the decompressor has issues, see
    7682     * <ul>
    77      *     <li>{@link LZMACompressorInputStream}</li>
    78      *     <li>{@link ZstdCompressorInputStream}</li>
    7983     *     <li>{@link BZip2CompressorInputStream}</li>
    8084     * </ul>
     
    8690            case raw:
    8791                return bais;
    88             case lzma:
    89                 return new LZMACompressorInputStream(bais);
    90             case zstd:
    91                 return new ZstdCompressorInputStream(bais);
    9292            case bzip2:
    9393                return new BZip2CompressorInputStream(bais);
     94            case lzma:
     95            case zstd:
    9496            case lz4:
    95                 throw new IOException("lz4 pbf is not currently supported");
     97                throw new IOException(this.compressionType + " pbf is not currently supported");
    9698            case zlib:
    9799                return new InflaterInputStream(bais);
Note: See TracChangeset for help on using the changeset viewer.