Changeset 19024 in josm for trunk/src/org
- Timestamp:
- 2024-04-02T18:57:56+02:00 (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmPbfReader.java
r18877 r19024 185 185 int size = Integer.MIN_VALUE; 186 186 Blob.CompressionType type = null; 187 ProtobufRecord current = null; 187 ProtobufRecord current; 188 // Needed since size and compression type + compression data may be in a different order 189 byte [] bytes = null; 188 190 while (parser.hasNext() && cis.getBytesRead() - start < header.dataSize()) { 189 191 current = new ProtobufRecord(baos, parser); … … 191 193 case 1: 192 194 type = Blob.CompressionType.raw; 195 bytes = current.getBytes(); 193 196 break; 194 197 case 2: … … 197 200 case 3: 198 201 type = Blob.CompressionType.zlib; 202 bytes = current.getBytes(); 199 203 break; 200 204 case 4: 201 205 type = Blob.CompressionType.lzma; 206 bytes = current.getBytes(); 202 207 break; 203 208 case 5: 204 209 type = Blob.CompressionType.bzip2; 210 bytes = current.getBytes(); 205 211 break; 206 212 case 6: 207 213 type = Blob.CompressionType.lz4; 214 bytes = current.getBytes(); 208 215 break; 209 216 case 7: 210 217 type = Blob.CompressionType.zstd; 218 bytes = current.getBytes(); 211 219 break; 212 220 default: … … 217 225 throw new IllegalStateException("Compression type not found, pbf may be malformed"); 218 226 } 219 return new Blob(size, type, current.getBytes());227 return new Blob(size, type, bytes); 220 228 } 221 229
Note:
See TracChangeset
for help on using the changeset viewer.