java.io.InputStream enricher class that adds the firstBlockIndex functionality.
The idea is that every BlobHeaders starts with the same pattern. So to be able to find the first BlobHeader in
a chunk file, we are looking for that pattern.
Just before every BlobHeader, there is a set of 4 bytes that contains the size of the next BlobHeader, but of course
it is not a fixed value like the pattern. It is necessary to keep it in mind to ignore these 4 bytes.
So this is the structure of every block that contains data:
java.io.InputStream
enricher class that adds thefirstBlockIndex
functionality.The idea is that every
BlobHeader
s starts with the samepattern
. So to be able to find the firstBlobHeader
in a chunk file, we are looking for thatpattern
.Just before every
BlobHeader
, there is a set of 4 bytes that contains the size of the nextBlobHeader
, but of course it is not a fixed value like thepattern
. It is necessary to keep it in mind to ignore these 4 bytes.So this is the structure of every block that contains data:
OSM PBF Format documentation