[osmosis] 01/07: New upstream version 0.46

Bas Couwenberg sebastic at debian.org
Tue Sep 26 14:59:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository osmosis.

commit b02fa61b4bea2b8a5af9def18a7ee53334dabeaf
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Tue Sep 26 16:44:38 2017 +0200

    New upstream version 0.46
---
 .gitignore                                         |     1 +
 .travis.yml                                        |     5 +
 README                                             |    50 -
 README.md                                          |    78 +
 build-support/docker/build.sh                      |    13 +
 build-support/docker/build/Dockerfile              |    17 +
 build-support/docker/build/build.sh                |     9 +
 {db-server => build-support/docker/db}/.gitignore  |     0
 build-support/docker/db/Dockerfile                 |    17 +
 build-support/docker/db/build.sh                   |    11 +
 .../docker/db}/docker-start.sh                     |     3 -
 {db-server => build-support/docker/db}/readme.txt  |     2 +-
 build-support/docker/db/script                     |     1 +
 build-support/docker/docker-compose.yml            |    13 +
 build-support/docker/env.sh                        |     4 +
 build-support/docker/run.sh                        |    23 +
 build.gradle                                       |     6 +-
 db-server/Dockerfile                               |    14 -
 db-server/build.sh                                 |     6 -
 db-server/script                                   |     1 -
 docker.sh                                          |    12 +
 gradle.properties                                  |    22 +-
 gradle/wrapper/gradle-wrapper.jar                  |   Bin 52266 -> 54708 bytes
 gradle/wrapper/gradle-wrapper.properties           |     3 +-
 gradlew                                            |    78 +-
 gradlew.bat                                        |    14 +-
 .../osmosis/apidb/common/BaseTableReader.java      |     4 +-
 .../osmosis/apidb/common/DatabaseContext.java      |    98 +-
 .../osmosis/apidb/common/DatabaseContext2.java     |   127 +-
 .../osmosis/apidb/common/IdentityValueLoader.java  |     4 +-
 .../apidb/common/MysqlIdentityValueLoader.java     |    44 +-
 .../apidb/common/MysqlIdentityValueLoader2.java    |     2 +-
 .../common/PostgresqlIdentityValueLoader.java      |    68 +-
 .../common/PostgresqlIdentityValueLoader2.java     |     2 +-
 .../osmosis/apidb/v0_6/ApidbChangeReader.java      |    42 +-
 .../osmosis/apidb/v0_6/ApidbChangeWriter.java      |     4 +-
 .../osmosis/apidb/v0_6/ApidbCurrentReader.java     |    19 +-
 .../osmosis/apidb/v0_6/ApidbFileReplicator.java    |     7 +-
 .../osmosis/apidb/v0_6/ApidbReader.java            |    24 +-
 .../osmosis/apidb/v0_6/ApidbTruncator.java         |     9 +-
 .../osmosis/apidb/v0_6/ApidbVersionConstants.java  |    16 +-
 .../osmosis/apidb/v0_6/ApidbWriter.java            |   153 +-
 .../osmosis/apidb/v0_6/impl/AllEntityDao.java      |    32 +-
 .../osmosis/apidb/v0_6/impl/ChangeReader.java      |     4 +-
 .../osmosis/apidb/v0_6/impl/ChangeWriter.java      |   120 +-
 .../osmosis/apidb/v0_6/impl/ChangesetManager.java  |    37 +-
 .../osmosis/apidb/v0_6/impl/DeltaToDiffReader.java |     4 +-
 .../apidb/v0_6/impl/EntityContainerReader.java     |     4 +-
 .../osmosis/apidb/v0_6/impl/EntityDao.java         |     6 +-
 .../apidb/v0_6/impl/EntityHistoryListReader.java   |     4 +-
 .../apidb/v0_6/impl/EntityHistoryReader.java       |     4 +-
 .../apidb/v0_6/impl/EntitySnapshotReader.java      |     4 +-
 .../apidb/v0_6/impl/FeatureHistoryPopulator.java   |     4 +-
 .../osmosis/apidb/v0_6/impl/RelationDao.java       |     2 +-
 .../osmosis/apidb/v0_6/impl/Replicator.java        |    10 +-
 .../apidb/v0_6/impl/SchemaVersionValidator.java    |    37 +-
 .../osmosis/apidb/v0_6/impl/UserManager.java       |    54 +-
 .../osmosis/apidb/v0_6/impl/WayDao.java            |     2 +-
 .../apidb/v0_6/impl/ChangesetManagerTest.java      |    49 +-
 .../v0_6/impl/MockReplicationDestination.java      |     2 +-
 .../data/template/v0_6/apidb-authfile.txt          |     2 +-
 .../areafilter/common/PolygonFileReader.java       |    68 +-
 .../osmosis/areafilter/v0_6/AreaFilter.java        |    58 +-
 .../osmosis/areafilter/v0_6/AreaFilterTest.java    |    12 +-
 .../areafilter/v0_6/BoundingBoxFilterTest.java     |     2 +-
 .../osmosis/areafilter/v0_6/PolygonFilterTest.java |     2 +-
 osmosis-core/build.gradle                          |     2 -
 .../org/openstreetmap/osmosis/core/LogLevels.java  |    30 +-
 .../openstreetmap/osmosis/core/TaskRegistrar.java  |    18 +-
 .../osmosis/core/bound/v0_6/BoundComputer.java     |    20 +-
 .../osmosis/core/bound/v0_6/BoundSetter.java       |     4 +-
 .../osmosis/core/buffer/v0_6/ChangeBuffer.java     |     6 +-
 .../osmosis/core/buffer/v0_6/EntityBuffer.java     |     6 +-
 .../osmosis/core/cli/CommandLineParser.java        |     8 +-
 .../container/v0_6/BoundContainerIterator.java     |     4 +-
 .../core/container/v0_6/NodeContainerIterator.java |     4 +-
 .../container/v0_6/RelationContainerIterator.java  |     4 +-
 .../core/container/v0_6/WayContainerIterator.java  |     4 +-
 .../database/AuthenticationPropertiesLoader.java   |    27 +-
 .../osmosis/core/database/DatabaseConstants.java   |    15 +-
 .../osmosis/core/database/FeaturePopulator.java    |     4 +-
 .../database/ReleasableStatementContainer.java     |     6 +-
 .../core/filter/common/BitSetIdTracker.java        |     2 +-
 .../core/filter/common/DynamicIdTracker.java       |     2 +-
 .../osmosis/core/filter/common/ListIdTracker.java  |     2 +-
 .../osmosis/core/lifecycle/Closeable.java          |    24 +
 .../osmosis/core/lifecycle/Completable.java        |     2 +-
 .../core/lifecycle/CompletableContainer.java       |     6 +-
 .../osmosis/core/lifecycle/Releasable.java         |    25 -
 .../core/lifecycle/ReleasableContainer.java        |    14 +-
 .../osmosis/core/lifecycle/ReleasableIterator.java |     2 +-
 .../osmosis/core/misc/v0_6/EmptyChangeReader.java  |     2 +-
 .../osmosis/core/misc/v0_6/EmptyReader.java        |     2 +-
 .../osmosis/core/misc/v0_6/NullChangeWriter.java   |     2 +-
 .../osmosis/core/misc/v0_6/NullWriter.java         |     2 +-
 .../core/progress/v0_6/ChangeProgressLogger.java   |     4 +-
 .../core/progress/v0_6/EntityProgressLogger.java   |     4 +-
 .../osmosis/core/report/v0_6/EntityReporter.java   |    32 +-
 .../core/report/v0_6/IntegrityReporter.java        |     2 +-
 .../osmosis/core/sort/common/FileBasedSort.java    |    12 +-
 .../osmosis/core/sort/common/MergingIterator.java  |     8 +-
 .../osmosis/core/sort/v0_6/ChangeSorter.java       |    16 +-
 .../osmosis/core/sort/v0_6/ChangeTagSorter.java    |     4 +-
 .../osmosis/core/sort/v0_6/EntitySorter.java       |    57 +-
 .../sort/v0_6/SortedDeltaChangePipeValidator.java  |     4 +-
 .../v0_6/SortedDuplicateEntityPipeValidator.java   |     4 +-
 .../core/sort/v0_6/SortedEntityPipeValidator.java  |     4 +-
 .../v0_6/SortedHistoryChangePipeValidator.java     |     4 +-
 .../osmosis/core/sort/v0_6/TagSorter.java          |     4 +-
 .../store/BufferedRandomAccessFileInputStream.java |     2 +-
 .../osmosis/core/store/ChunkedObjectStore.java     |     8 +-
 .../osmosis/core/store/DataPostbox.java            |     4 +-
 .../core/store/DataPostboxLoadInjector.java        |     2 +-
 .../osmosis/core/store/EmptyIterator.java          |     2 +-
 .../osmosis/core/store/IndexStore.java             |    29 +-
 .../osmosis/core/store/IndexStoreReader.java       |    10 +-
 .../osmosis/core/store/IndexedObjectStore.java     |     8 +-
 .../core/store/IndexedObjectStoreReader.java       |    10 +-
 .../osmosis/core/store/MultipleSourceIterator.java |     6 +-
 .../osmosis/core/store/ObjectStreamIterator.java   |     2 +-
 .../osmosis/core/store/PeekableIterator.java       |     4 +-
 .../osmosis/core/store/PersistentIterator.java     |    10 +-
 .../core/store/RandomAccessObjectStore.java        |     2 +-
 .../core/store/RandomAccessObjectStoreReader.java  |     6 +-
 .../core/store/ReleasableAdaptorForIterator.java   |     2 +-
 .../osmosis/core/store/SegmentedObjectStore.java   |     2 +-
 .../osmosis/core/store/SimpleObjectStore.java      |     2 +-
 .../osmosis/core/store/StoreReleasingIterator.java |    12 +-
 .../core/store/StoreableConstructorCache.java      |     2 +-
 .../osmosis/core/store/UpcastIterator.java         |     4 +-
 .../osmosis/core/task/v0_6/DatasetSink.java        |     4 +-
 .../osmosis/core/tee/v0_6/ChangeTee.java           |    10 +-
 .../osmosis/core/tee/v0_6/EntityTee.java           |    10 +-
 .../osmosis/core/util/FileBasedLock.java           |     6 +-
 .../osmosis/core/util/PropertiesPersister.java     |    40 +-
 .../osmosis/core/util/ResourceFileManager.java     |    55 +-
 .../osmosis/core/bound/v0_6/BoundComputerTest.java |     8 +-
 .../osmosis/core/bound/v0_6/BoundSetterTest.java   |     8 +-
 .../osmosis/core/cli/CommandLineParserTest.java    |    30 +-
 .../core/sort/common/FileBasedSortTest.java        |    13 +-
 .../osmosis/testutil/v0_6/SinkEntityInspector.java |     2 +-
 .../dataset/v0_6/DatasetBoundingBoxFilter.java     |    15 +-
 .../osmosis/dataset/v0_6/DumpDataset.java          |    13 +-
 .../osmosis/dataset/v0_6/ReadDataset.java          |     4 +-
 .../osmosis/dataset/v0_6/WriteDataset.java         |     6 +-
 .../osmosis/dataset/v0_6/impl/DatasetStore.java    |    17 +-
 .../dataset/v0_6/impl/DatasetStoreFileManager.java |     4 +-
 .../dataset/v0_6/impl/DatasetStoreReader.java      |    51 +-
 .../dataset/v0_6/impl/NodeStorageContainer.java    |     8 +-
 .../impl/PermanentFileDatasetStoreFileManager.java |     2 +-
 .../v0_6/impl/RelationStorageContainer.java        |     8 +-
 .../v0_6/impl/RelationalIndexValueIdIterator.java  |     2 +-
 .../v0_6/impl/TempFileDatasetStoreFileManager.java |     2 +-
 .../v0_6/impl/TileIndexValueIdIterator.java        |     2 +-
 .../dataset/v0_6/impl/WayStorageContainer.java     |     8 +-
 .../dataset/v0_6/impl/WayTileAreaIndex.java        |    15 +-
 .../dataset/v0_6/impl/WayTileAreaIndexReader.java  |    10 +-
 .../osmosis/dataset/v0_6/CustomDbTest.java         |     4 +-
 .../extract/apidb/common/Configuration.java        |    19 +-
 .../extract/apidb/v0_6/DatabaseTimeLoader.java     |    31 +-
 .../extract/apidb/v0_6/OsmosisExtractApiDb.java    |     2 +-
 .../data/template/v0_6/apidb-authfile.txt          |     2 +-
 .../org/openstreetmap/osmosis/hstore/PGHStore.java |    18 +-
 .../osmosis/osmbinary/Fileformat.java              |  1358 +-
 .../openstreetmap/osmosis/osmbinary/Osmformat.java | 12786 ++++++++++---------
 .../osmosis/osmbinary/test/BuildTestFile.java      |     2 +-
 .../src/main/protobuf/fileformat.proto             |     2 +
 .../src/main/protobuf/osmformat.proto              |     2 +
 .../java/crosby/binary/osmosis/OsmosisReader.java  |     2 +-
 .../crosby/binary/osmosis/OsmosisSerializer.java   |     4 +-
 .../openstreetmap/osmosis/pbf2/v0_6/PbfReader.java |    54 +-
 .../osmosis/pbf2/v0_6/impl/PbfStreamSplitter.java  |     6 +-
 osmosis-pgsimple/build.gradle                      |     3 -
 .../osmosis/pgsimple/common/BaseDao.java           |     8 +-
 .../osmosis/pgsimple/common/BaseTableReader.java   |     2 +-
 .../common/CompactPersistentNodeLocationStore.java |     6 +-
 .../osmosis/pgsimple/common/CopyFileWriter.java    |    25 +-
 .../osmosis/pgsimple/common/DatabaseContext.java   |    60 +-
 .../pgsimple/common/InMemoryNodeLocationStore.java |     2 +-
 .../osmosis/pgsimple/common/NodeLocationStore.java |     4 +-
 .../common/PersistentNodeLocationStore.java        |     2 +-
 .../pgsimple/v0_6/PostgreSqlChangeWriter.java      |     4 +-
 .../pgsimple/v0_6/PostgreSqlCopyWriter.java        |    18 +-
 .../pgsimple/v0_6/PostgreSqlDatasetReader.java     |     2 +-
 .../pgsimple/v0_6/PostgreSqlDumpWriter.java        |     4 +-
 .../osmosis/pgsimple/v0_6/PostgreSqlTruncator.java |     2 +-
 .../osmosis/pgsimple/v0_6/PostgreSqlWriter.java    |     8 +-
 .../osmosis/pgsimple/v0_6/impl/ActionDataType.java |    11 +-
 .../osmosis/pgsimple/v0_6/impl/ChangeWriter.java   |     6 +-
 .../pgsimple/v0_6/impl/ChangesetAction.java        |    11 +-
 .../pgsimple/v0_6/impl/CopyFilesetBuilder.java     |     6 +-
 .../pgsimple/v0_6/impl/CopyFilesetLoader.java      |    32 +-
 .../osmosis/pgsimple/v0_6/impl/EntityDao.java      |    70 +-
 .../osmosis/pgsimple/v0_6/impl/EntityReader.java   |     6 +-
 .../v0_6/impl/PostgreSqlDatasetContext.java        |     6 +-
 .../osmosis/pgsimple/v0_6/impl/RelationReader.java |     6 +-
 .../pgsimple/v0_6/impl/TempCopyFileset.java        |     6 +-
 .../pgsimple/v0_6/impl/WayGeometryBuilder.java     |     8 +-
 .../osmosis/pgsimple/v0_6/impl/WayReader.java      |     6 +-
 .../osmosis/pgsimple/v0_6/DatasetDriver.java       |     9 +-
 .../osmosis/pgsimple/v0_6/PostgreSqlTest.java      |    28 +-
 .../pgsimple/v0_6/impl/NodeLocationStoreTest.java  |     2 +-
 .../data/template/v0_6/pgsql-authfile.txt          |     2 +-
 .../common/CompactPersistentNodeLocationStore.java |     6 +-
 .../osmosis/pgsnapshot/common/CopyFileWriter.java  |    25 +-
 .../pgsnapshot/common/DataSourceManager.java       |     6 +-
 .../osmosis/pgsnapshot/common/DatabaseContext.java |   141 +-
 .../common/InMemoryNodeLocationStore.java          |     2 +-
 .../pgsnapshot/common/NodeLocationStore.java       |     4 +-
 .../common/PersistentNodeLocationStore.java        |     2 +-
 .../pgsnapshot/v0_6/PostgreSqlChangeWriter.java    |     4 +-
 .../pgsnapshot/v0_6/PostgreSqlCopyWriter.java      |    16 +-
 .../pgsnapshot/v0_6/PostgreSqlDatasetReader.java   |     2 +-
 .../pgsnapshot/v0_6/PostgreSqlDumpWriter.java      |     4 +-
 .../pgsnapshot/v0_6/PostgreSqlTruncator.java       |     2 +-
 .../pgsnapshot/v0_6/impl/ActionDataType.java       |    11 +-
 .../pgsnapshot/v0_6/impl/ChangesetAction.java      |    11 +-
 .../pgsnapshot/v0_6/impl/CopyFilesetBuilder.java   |     6 +-
 .../pgsnapshot/v0_6/impl/CopyFilesetLoader.java    |     7 +-
 .../osmosis/pgsnapshot/v0_6/impl/EntityDao.java    |    11 +-
 .../osmosis/pgsnapshot/v0_6/impl/EntityReader.java |     4 +-
 .../pgsnapshot/v0_6/impl/FeaturePopulatorImpl.java |     4 +-
 .../v0_6/impl/PostgreSqlDatasetContext.java        |     4 +-
 .../osmosis/pgsnapshot/v0_6/impl/RelationDao.java  |     2 +-
 .../pgsnapshot/v0_6/impl/TempCopyFileset.java      |     6 +-
 .../pgsnapshot/v0_6/impl/WayGeometryBuilder.java   |     8 +-
 .../osmosis/pgsnapshot/v0_6/DatasetDriver.java     |     9 +-
 .../osmosis/pgsnapshot/v0_6/PostgreSqlTest.java    |    34 +-
 .../v0_6/impl/NodeLocationStoreTest.java           |     2 +-
 .../data/template/v0_6/pgsql-authfile.txt          |     2 +-
 .../template/v0_6/pgsql_with_schema-authfile.txt   |     2 +-
 .../v0_6/ReplicationDataClient.java                |     4 +-
 .../v0_6/ReplicationSequenceServer.java            |     4 +-
 .../v0_6/impl/ChunkedDataReceiver.java             |     6 +-
 .../v0_6/impl/ReplicationDataClientHandler.java    |     6 +-
 .../v0_6/impl/ReplicationDataServerHandler.java    |    10 +-
 .../v0_6/MockReplicationDestination.java           |     2 +-
 .../v0_6/MockReplicationSource.java                |     2 +-
 .../v0_6/ReplicationSequenceServerTest.java        |     2 +-
 .../replication/common/ServerStateReader.java      |    29 +-
 .../replication/common/TimestampTracker.java       |    52 +-
 .../v0_6/BaseReplicationDownloader.java            |    59 +-
 .../replication/v0_6/IntervalDownloader.java       |    83 +-
 .../v0_6/IntervalDownloaderInitializer.java        |     2 +-
 .../replication/v0_6/ReplicationDownloader.java    |     4 +-
 .../v0_6/ReplicationDownloaderInitializer.java     |     2 +-
 .../replication/v0_6/ReplicationFileMerger.java    |     8 +-
 .../v0_6/ReplicationFileMergerInitializer.java     |     2 +-
 .../replication/v0_6/ReplicationLagReader.java     |     2 +-
 .../replication/v0_6/ReplicationStateWriter.java   |     4 +-
 .../v0_6/ReplicationToChangeWriter.java            |     6 +-
 .../replication/v0_6/ReplicationWriter.java        |     8 +-
 .../osmosis/set/v0_6/BoundRemovedAction.java       |    15 +-
 .../osmosis/set/v0_6/ChangeAppender.java           |     2 +-
 .../osmosis/set/v0_6/ChangeApplier.java            |     2 +-
 .../osmosis/set/v0_6/ChangeDeriver.java            |     2 +-
 .../osmosis/set/v0_6/ChangeMerger.java             |     2 +-
 .../osmosis/set/v0_6/ChangeSimplifier.java         |     4 +-
 .../set/v0_6/ChangeToFullHistoryConvertor.java     |     4 +-
 .../osmosis/set/v0_6/EntityMerger.java             |     2 +-
 .../osmosis/set/v0_6/FlattenFilter.java            |     4 +-
 .../set/v0_6/impl/ChangeSimplifierImpl.java        |     4 +-
 .../set/v0_6/impl/DataPostboxChangeSink.java       |     4 +-
 .../osmosis/set/v0_6/impl/DataPostboxSink.java     |     4 +-
 .../osmosis/set/v0_6/ChangeAppenderTest.java       |     2 +-
 .../osmosis/set/v0_6/ChangeApplierTest.java        |     2 +-
 .../osmosis/set/v0_6/ChangeDeriverTest.java        |     2 +-
 .../osmosis/set/v0_6/ChangeSimplifierTest.java     |     6 +-
 .../osmosis/set/v0_6/EntityMergerTest.java         |    22 +-
 .../osmosis/set/v0_6/FlattenFilterTest.java        |     6 +-
 .../osmosis/set/v0_6/MergeBoundTest.java           |     4 +-
 .../osmosis/tagfilter/v0_6/NodeKeyFilter.java      |     4 +-
 .../osmosis/tagfilter/v0_6/NodeKeyValueFilter.java |     4 +-
 .../osmosis/tagfilter/v0_6/TagFilter.java          |     4 +-
 .../osmosis/tagfilter/v0_6/TagRemover.java         |     4 +-
 .../osmosis/tagfilter/v0_6/UsedNodeFilter.java     |    16 +-
 .../osmosis/tagfilter/v0_6/UsedWayFilter.java      |    16 +-
 .../osmosis/tagfilter/v0_6/WayKeyFilter.java       |     4 +-
 .../osmosis/tagfilter/v0_6/WayKeyValueFilter.java  |     4 +-
 .../tagfilter/v0_6/NodeKeyValueFilterTest.java     |     2 +-
 .../osmosis/tagfilter/v0_6/TagFilterTest.java      |     6 +-
 .../osmosis/tagfilter/v0_6/TagRemoverTest.java     |     4 +-
 .../tagfilter/v0_6/WayKeyValueFilterTest.java      |     2 +-
 .../osmosis/tagtransform/impl/TransformHelper.java |     4 +-
 .../osmosis/testutil/v0_6/SinkChangeInspector.java |     2 +-
 .../osmosis/testutil/v0_6/SinkEntityInspector.java |     2 +-
 .../osmosis/xml/common/BaseXmlWriter.java          |     2 +-
 .../osmosis/xml/v0_6/FastXmlReader.java            |     2 +-
 .../osmosis/xml/v0_6/XmlChangeReader.java          |     2 +-
 .../osmosis/xml/v0_6/XmlChangeUploader.java        |     2 +-
 .../osmosis/xml/v0_6/XmlDownloader.java            |     2 +-
 .../openstreetmap/osmosis/xml/v0_6/XmlReader.java  |     2 +-
 .../v0_6/impl/ChangeSourceElementProcessor.java    |     6 +-
 .../osmosis/xml/v0_6/impl/OsmWriter.java           |     2 +-
 .../osmosis/xml/common/ElementWriterTest.java      |     2 +-
 .../osmosis/xml/v0_6/XmlReaderWriterTest.java      |     4 +-
 .../osmosis/xml/v0_6/impl/NodeWriterTest.java      |     4 +-
 .../osmosis/xml/v0_6/impl/OsmHandlerTest.java      |    18 +-
 .../osmosis/xml/v0_6/impl/RelationWriterTest.java  |     6 +-
 .../osmosis/xml/v0_6/impl/WayWriterTest.java       |     6 +-
 package/changes.txt                                |    17 +-
 settings.gradle                                    |     1 -
 302 files changed, 8594 insertions(+), 9385 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7fb4583..b41d549 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 .gradle
+.idea
 *.javaEe
 *.javae
 *.iml
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..cad4243
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,5 @@
+services:
+  - docker
+
+script:
+  - ./docker.sh ./gradlew build
diff --git a/README b/README
deleted file mode 100644
index b815569..0000000
--- a/README
+++ /dev/null
@@ -1,50 +0,0 @@
-Osmosis is a command line Java application for processing Open Street Map
-(http://www.openstreetmap.org) data.
-
-The tool consists of a series of pluggable components that can be chained
-together to perform a larger operation. For example, it has components for
-reading from database and from file, components for writing to database and to
-file, components for deriving and applying change sets to data sources,
-components for sorting data, etc. It has been written so that it is easy to add
-new features without re-writing common tasks such as file or database handling.
-
-Some brief build, running and installation notes are provided below, however
-most documentation may be found on the project wiki page.
-http://wiki.openstreetmap.org/wiki/Osmosis
-
-**** BUILD ****
-Osmosis is built using the Gradle (http://gradle.org) built tool, however
-Gradle does not need to be installed.  The only requirements are a 1.6 JDK, and
-an Internet connection.
-
-Below are several commands useful to build the software.  All commands must be
-run from the root of the source tree.
- 
-Build the software without running unit tests:
-./gradlew assemble
-
-Perform a complete build including unit tests:
-./gradlew build
-
-Clean the build tree:
-./gradlew clean
-
-Verify checkstyle compliance:
-./gradlew checkstyleMain checkstyleTest
-
-**** RUNNING ****
-After completing the build process, a working Osmosis installation is contained
-in the package sub-directory.  The Osmosis launcher scripts reside in the bin
-sub-directory of package.  On a UNIX-like environment use the "osmosis" script,
-on a Windows environment use the "osmosis.bat" script.
-
-However, for installing the software it is recommended to use a distribution
-archive described below.
-
-**** INSTALLATION ****
-After completing the build process, distribution archives in zip and tar gzipped
-formats are contained in the package/build/distribution directory.  These
-archives may be extracted to a location of your choice.  The bin sub-directory
-should either be added to your PATH, or in the case of UNIX-like environments
-the "osmosis" script may be symlinked into an existing directory already on the
-PATH.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a5b5268
--- /dev/null
+++ b/README.md
@@ -0,0 +1,78 @@
+# Osmosis
+[![Build Status](https://travis-ci.org/openstreetmap/osmosis.svg?branch=master)](https://travis-ci.org/openstreetmap/osmosis)
+
+## Overview
+
+Osmosis is a command line Java application for processing Open Street Map
+(http://www.openstreetmap.org) data.
+
+The tool consists of a series of pluggable components that can be chained
+together to perform a larger operation. For example, it has components for
+reading from database and from file, components for writing to database and to
+file, components for deriving and applying change sets to data sources,
+components for sorting data, etc. It has been written so that it is easy to add
+new features without re-writing common tasks such as file or database handling.
+
+Some brief build, running and installation notes are provided below, however
+most documentation may be found on the project wiki page.
+http://wiki.openstreetmap.org/wiki/Osmosis
+
+## Installation
+
+It is recommended to use a pre-built distribution archive rather than compile
+from source.  The location of the latest builds are specified on the project
+wiki. These archives may be extracted to a location of your choice.  The bin
+sub-directory should either be added to your PATH, or in the case of UNIX-like
+environments the "osmosis" script may be symlinked into an existing directory
+already on the PATH.
+
+## Development
+
+The easiest way to perform a full Osmosis build is to use the docker-based
+development environment.  If you have docker and docker-compose installed,
+simply run the following command to build and launch a shell with everything
+required to run the full build and test suite.
+
+    ./docker.sh
+
+Osmosis is built using the Gradle (http://gradle.org) built tool.  Gradle itself
+does not need to be installed because the gradlew script will install Gradle on
+first usage.  The only requirements are a 1.7 JDK, and an Internet connection.
+Note that in the docker environment all downloads will still occur and be cached
+in your home directory.
+
+Below are several commands useful to build the software.  All commands must be
+run from the root of the source tree.
+
+Perform a complete build including unit tests:
+    ./gradlew build
+
+Build the software without running unit tests:
+
+    ./gradlew assemble
+
+Clean the build tree:
+    ./gradlew clean
+
+Generate project files to allow the project to be imported into IntelliJ.
+
+    ./gradlew idea
+
+Generate project files to allow the project to be imported into Eclipse.
+
+    ./gradlew eclipse
+
+Verify checkstyle compliance:
+    ./gradlew checkstyleMain checkstyleTest
+
+After completing the build process, a working Osmosis installation is contained
+in the package sub-directory.  The Osmosis launcher scripts reside in the bin
+sub-directory of package.  On a UNIX-like environment use the "osmosis" script,
+on a Windows environment use the "osmosis.bat" script.
+
+Distribution archives in zip and tar gzipped formats are contained in the
+package/build/distribution directory.
+
+## Issue Tracking
+
+See https://trac.openstreetmap.org/query?status=!closed&component=osmosis
diff --git a/build-support/docker/build.sh b/build-support/docker/build.sh
new file mode 100755
index 0000000..26c9e26
--- /dev/null
+++ b/build-support/docker/build.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+set -e
+
+scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "${scriptDir}"
+. ./env.sh
+
+# Build the docker image used for the interactive gradle enabled build environment.
+./build/build.sh
+
+# Build the docker image for the database server used for running database task integration tests.
+./db/build.sh
diff --git a/build-support/docker/build/Dockerfile b/build-support/docker/build/Dockerfile
new file mode 100644
index 0000000..00150a1
--- /dev/null
+++ b/build-support/docker/build/Dockerfile
@@ -0,0 +1,17 @@
+FROM java:8
+
+ARG CURRENT_USER_ID
+ARG CURRENT_GROUP_ID
+
+RUN mkdir /gradle
+RUN chown "${CURRENT_USER_ID}":"${CURRENT_GROUP_ID}" /gradle
+ENV GRADLE_USER_HOME /gradle
+
+# Fix the broken PS1 prompt caused by the runtime UID not existing in the container.
+RUN echo "PS1=\"[osmosis-dev \\w]\\$ \"" >> /etc/bash.bashrc
+
+USER "${CURRENT_USER_ID}":"${CURRENT_GROUP_ID}"
+
+WORKDIR /project
+VOLUME /project
+VOLUME /home/builder/.gradle
diff --git a/build-support/docker/build/build.sh b/build-support/docker/build/build.sh
new file mode 100755
index 0000000..dabfa62
--- /dev/null
+++ b/build-support/docker/build/build.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+set -e
+
+scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "${scriptDir}"
+
+# Build the docker image.
+docker build -t="openstreetmap.org/osmosis-build-${userId}" --build-arg CURRENT_USER_ID=${userId} --build-arg CURRENT_GROUP_ID=${groupId} .
diff --git a/db-server/.gitignore b/build-support/docker/db/.gitignore
similarity index 100%
rename from db-server/.gitignore
rename to build-support/docker/db/.gitignore
diff --git a/build-support/docker/db/Dockerfile b/build-support/docker/db/Dockerfile
new file mode 100644
index 0000000..197efbb
--- /dev/null
+++ b/build-support/docker/db/Dockerfile
@@ -0,0 +1,17 @@
+FROM fedora:24
+
+# Install UTF8 locale support
+RUN dnf install -y langpacks-en.noarch
+
+# Install PostgreSQL
+RUN dnf install -y postgresql-server postgresql-contrib
+
+# Install PostGIS
+RUN dnf install -y postgis
+
+EXPOSE 5432
+
+COPY docker-start.sh /start.sh
+COPY script /install/script
+
+CMD ["/start.sh"]
diff --git a/build-support/docker/db/build.sh b/build-support/docker/db/build.sh
new file mode 100755
index 0000000..ca49351
--- /dev/null
+++ b/build-support/docker/db/build.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+set -e
+
+scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "${scriptDir}"
+
+# Build the docker image.
+# The use of tar is a workaround for the docker restriction of not following symlinks.  This
+# tar command dereferences symlinks and then passes the resultant archive to the docker build.
+tar -czh . | docker build -t="openstreetmap.org/osmosis-db" -
diff --git a/db-server/docker-start.sh b/build-support/docker/db/docker-start.sh
similarity index 96%
rename from db-server/docker-start.sh
rename to build-support/docker/db/docker-start.sh
index 7461954..481db47 100755
--- a/db-server/docker-start.sh
+++ b/build-support/docker/db/docker-start.sh
@@ -4,9 +4,6 @@ DATADIR="/var/lib/pgsql/data"
 
 # test if DATADIR has content
 if [ ! "$(ls -A $DATADIR)" ]; then
-	# Create the en_US.UTF-8 locale.  We need UTF-8 support in the database.
-	localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
-
 	echo "Initializing Postgres Database at $DATADIR"
 	su postgres sh -lc "initdb --encoding=UTF-8 --locale=en_US.UTF-8"
 
diff --git a/db-server/readme.txt b/build-support/docker/db/readme.txt
similarity index 86%
rename from db-server/readme.txt
rename to build-support/docker/db/readme.txt
index 57e586d..7597614 100644
--- a/db-server/readme.txt
+++ b/build-support/docker/db/readme.txt
@@ -6,7 +6,7 @@ To build the docker image, run the following script.
     ./build.sh
 
 To run the docker image, run the following command.  To stop the server, press Ctrl-C.
-    docker run -ti --rm=true --name osmosis-build -p 5432:5432 bretth/osmosis-build
+    docker run -ti --rm=true --name osmosis-build -p 5432:5432 openstreetmap.org/osmosis-db
 
 If you wish to troubleshoot a running server, you may run the following command to get a bash prompt
 inside the docker container.
diff --git a/build-support/docker/db/script b/build-support/docker/db/script
new file mode 120000
index 0000000..cc81ab8
--- /dev/null
+++ b/build-support/docker/db/script
@@ -0,0 +1 @@
+../../../package/script
\ No newline at end of file
diff --git a/build-support/docker/docker-compose.yml b/build-support/docker/docker-compose.yml
new file mode 100644
index 0000000..8cdb6ba
--- /dev/null
+++ b/build-support/docker/docker-compose.yml
@@ -0,0 +1,13 @@
+version: "2"
+
+services:
+  build:
+    image: openstreetmap.org/osmosis-build-${userId}
+
+    links:
+      - db
+    volumes:
+      - ${gradleUserDir}:/gradle
+      - ${projectDir}:/project
+  db:
+    image: openstreetmap.org/osmosis-db
diff --git a/build-support/docker/env.sh b/build-support/docker/env.sh
new file mode 100644
index 0000000..2ebd346
--- /dev/null
+++ b/build-support/docker/env.sh
@@ -0,0 +1,4 @@
+export gradleUserDir="${HOME}/.gradle"
+export userId=$(id -u)
+export groupId=$(id -g)
+export projectDir="$( cd "${scriptDir}"/../.. && pwd )"
diff --git a/build-support/docker/run.sh b/build-support/docker/run.sh
new file mode 100755
index 0000000..843583c
--- /dev/null
+++ b/build-support/docker/run.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+set -e
+
+scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "${scriptDir}"
+. ./env.sh
+
+# Create gradle directory in user home if it doesn't already exist.
+if [ ! -d "${gradleUserDir}" ]; then
+    mkdir "${gradleUserDir}"
+fi
+
+# Launch our docker build container interactively and destroy on exit.
+runCommand="docker-compose run --rm build"
+if [ $# -eq 0 ]; then
+    ${runCommand} /bin/bash
+else
+    ${runCommand} "${@}"
+fi
+
+# Remove remaining containers (e.g. db server)
+docker-compose down -v
diff --git a/build.gradle b/build.gradle
index 0493b24..a5a4866 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,5 @@
 task wrapper(type: Wrapper) {
-	gradleVersion = '2.4'
+	gradleVersion = '4.2'
 }
 
 apply plugin: 'idea'
@@ -40,7 +40,7 @@ configure(javaProjects) {
 	apply plugin: 'maven'
 	apply plugin: 'signing'
 
-	sourceCompatibility = 1.7
+	sourceCompatibility = 1.8
 
 	test {
 		/*
@@ -76,7 +76,7 @@ configure(javaProjects) {
 	}
 	artifacts {
 	    archives jar
-	
+
 	    archives javadocJar
 	    archives sourcesJar
 	}
diff --git a/db-server/Dockerfile b/db-server/Dockerfile
deleted file mode 100644
index fea9195..0000000
--- a/db-server/Dockerfile
+++ /dev/null
@@ -1,14 +0,0 @@
-FROM fedora:21
-
-# Install PostgreSQL
-RUN yum install -y postgresql-server postgresql-contrib
-
-# Install PostGIS
-RUN yum install -y postgis
-
-EXPOSE 5432
-
-COPY docker-start.sh /start.sh
-COPY script /install/script
-
-CMD ["/start.sh"]
diff --git a/db-server/build.sh b/db-server/build.sh
deleted file mode 100755
index 2b1e1a9..0000000
--- a/db-server/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# Build the docker image.
-# The use of tar is a workaround for the docker restriction of not following symlinks.  This
-# tar command dereferences symlinks and then passes the resultant archive to the docker build. 
-tar -czh . | docker build -t="bretth/osmosis-build" -
diff --git a/db-server/script b/db-server/script
deleted file mode 120000
index a8cd555..0000000
--- a/db-server/script
+++ /dev/null
@@ -1 +0,0 @@
-../package/script
\ No newline at end of file
diff --git a/docker.sh b/docker.sh
new file mode 100755
index 0000000..a0fdab3
--- /dev/null
+++ b/docker.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+set -e
+
+scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "${scriptDir}"
+
+# Build docker images.
+./build-support/docker/build.sh
+
+# Run our interactive gradle enabled build environment.
+./build-support/docker/run.sh "${@}"
diff --git a/gradle.properties b/gradle.properties
index 3ff25ff..cf311fb 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,23 +6,19 @@ org.gradle.daemon=true
 # 3rd Party Library Versions
 dependencyVersionClassworlds=2.5.2
 dependencyVersionCommonsCodec=1.10
-dependencyVersionCommonsCompress=1.10
+dependencyVersionCommonsCompress=1.14
 dependencyVersionCommonsDbcp=1.4
 dependencyVersionJpf=1.5
 dependencyVersionJunit=4.12
-dependencyVersionMySql=5.1.37
-dependencyVersionNetty=3.10.5.Final
-dependencyVersionPostGis=2.1.7.2
-dependencyVersionPostgreSql=9.4-1204-jdbc4
-dependencyVersionProtobuf=2.6.1
-dependencyVersionSpring=4.2.2.RELEASE
-dependencyVersionWoodstoxCore=5.0.1
+dependencyVersionMySql=6.0.6
+dependencyVersionNetty=3.10.6.Final
+dependencyVersionPostGis=2.2.1
+dependencyVersionPostgreSql=42.1.4
+dependencyVersionProtobuf=3.4.0
+dependencyVersionSpring=4.3.11.RELEASE
+dependencyVersionWoodstoxCore=5.0.3
 dependencyVersionWoodstoxStax2=4.0.0
-# Remaining on 2.9.1 instead of 2.10.0 for now because the newer version
-# depends on org.w3c.dom.ElementTraversal which is not being transitively
-# included. This could be possibly be fixed by including a newer version
-# of xml-apis but this hasn't been verified.
-dependencyVersionXerces=2.9.1
+dependencyVersionXerces=2.11.0
 
 # Builds are signed if the osmosisSigningEnabled property is set to true.
 # To enable signing, it is recommended to leave this file untouched and to
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index b5166da..736fb7d 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 4c550e0..52dd1f0 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Wed Jun 03 22:25:15 EST 2015
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-bin.zip
diff --git a/gradlew b/gradlew
index 91a7e26..cccdd3d 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
 
 ##############################################################################
 ##
@@ -6,20 +6,38 @@
 ##
 ##############################################################################
 
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
 
 APP_NAME="Gradle"
 APP_BASE_NAME=`basename "$0"`
 
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD="maximum"
 
-warn ( ) {
+warn () {
     echo "$*"
 }
 
-die ( ) {
+die () {
     echo
     echo "$*"
     echo
@@ -30,6 +48,7 @@ die ( ) {
 cygwin=false
 msys=false
 darwin=false
+nonstop=false
 case "`uname`" in
   CYGWIN* )
     cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
   MINGW* )
     msys=true
     ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
 esac
 
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
-    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '/.*' > /dev/null; then
-        PRG="$link"
-    else
-        PRG=`dirname "$PRG"`"/$link"
-    fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
 
 # Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
 fi
 
 # Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
     MAX_FD_LIMIT=`ulimit -H -n`
     if [ $? -eq 0 ] ; then
         if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
 if $cygwin ; then
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
 
     # We build the pattern for arguments to be converted via cygpath
     ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
     esac
 fi
 
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
-    JVM_OPTS=("$@")
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
 }
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
 
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index aec9973..e95643d 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -8,14 +8,14 @@
 @rem Set local scope for the variables with windows NT shell
 if "%OS%"=="Windows_NT" setlocal
 
- at rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
 set DIRNAME=%~dp0
 if "%DIRNAME%" == "" set DIRNAME=.
 set APP_BASE_NAME=%~n0
 set APP_HOME=%DIRNAME%
 
+ at rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
 @rem Find java.exe
 if defined JAVA_HOME goto findJavaFromJavaHome
 
@@ -46,10 +46,9 @@ echo location of your Java installation.
 goto fail
 
 :init
- at rem Get command-line arguments, handling Windowz variants
+ at rem Get command-line arguments, handling Windows variants
 
 if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
 
 :win9xME_args
 @rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
 if "x%~1" == "x" goto execute
 
 set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
- at rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
 
 :execute
 @rem Setup the command line
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/BaseTableReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/BaseTableReader.java
index 4197bbd..132d0fc 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/BaseTableReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/BaseTableReader.java
@@ -135,11 +135,11 @@ public abstract class BaseTableReader<T> implements ReleasableIterator<T> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		nextValue = null;
 		resultSet = null;
 		
-		dbCtx.release();
+		dbCtx.close();
 	}
 	
 	
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext.java
index 399188b..94990e9 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext.java
@@ -22,7 +22,7 @@ import org.openstreetmap.osmosis.core.database.DatabaseType;
  * 
  * @author Brett Henderson
  */
-public class DatabaseContext {
+public class DatabaseContext implements AutoCloseable {
 
     private static final Logger LOG = Logger.getLogger(DatabaseContext.class.getName());
 
@@ -60,13 +60,16 @@ public class DatabaseContext {
                 identityValueLoader = new MysqlIdentityValueLoader(this);
                 break;
             default:
-                throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
+                throw createUnknownDbTypeException();
             }
 
         } catch (ClassNotFoundException e) {
             throw new OsmosisRuntimeException("Unable to find database driver.", e);
         }
+    }
 
+    private OsmosisRuntimeException createUnknownDbTypeException() {
+        return new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
     }
 
     /**
@@ -85,7 +88,7 @@ public class DatabaseContext {
                 connection = getMysqlConnection();
                 break;
             default:
-                throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
+                throw createUnknownDbTypeException();
             }
         }
         
@@ -187,8 +190,8 @@ public class DatabaseContext {
 			}
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
-		}
+            throw createUnknownDbTypeException();
+        }
 	}
 	
 	
@@ -209,8 +212,8 @@ public class DatabaseContext {
 			}
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
-		}
+            throw createUnknownDbTypeException();
+        }
 	}
 	
 	
@@ -231,8 +234,8 @@ public class DatabaseContext {
 			}
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
-		}
+            throw createUnknownDbTypeException();
+        }
 	}
 	
 	
@@ -263,8 +266,8 @@ public class DatabaseContext {
         	executeStatement(statementBuilder.toString());
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
-		}
+            throw createUnknownDbTypeException();
+        }
 	}
 	
 	
@@ -283,8 +286,8 @@ public class DatabaseContext {
         	executeStatement("UNLOCK TABLES");
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
-		}
+            throw createUnknownDbTypeException();
+        }
 	}
 
 
@@ -363,13 +366,12 @@ public class DatabaseContext {
 	        	streamingStatement.setFetchSize(Integer.MIN_VALUE);
 				break;
 			default:
-				throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
-			}
+                throw createUnknownDbTypeException();
+            }
     	} catch (SQLException e) {
     		throw new OsmosisRuntimeException("Unable to update statement fetch size.", e);
     	}
     }
-    
 
     /**
 	 * Creates a new database statement that is configured so that any result sets created using it
@@ -446,9 +448,19 @@ public class DatabaseContext {
     /**
      * Releases all database resources. This method is guaranteed not to throw transactions and
      * should always be called in a finally block whenever this class is used.
+     * 
+     * @deprecated Use {@link #close()} instead.
      */
     public void release() {
-    	identityValueLoader.release();
+    	close();
+    }
+
+    /**
+     * Releases all database resources. This method is guaranteed not to throw transactions and
+     * should always be called in a finally or try-with-resources block whenever this class is used.
+     */
+    public void close() {
+    	identityValueLoader.close();
     	
         if (statement != null) {
             try {
@@ -500,31 +512,13 @@ public class DatabaseContext {
      * @return True if the column exists, false otherwise.
      */
     public boolean doesColumnExist(String tableName, String columnName) {
-        ResultSet resultSet = null;
-        boolean result;
-
-        try {
-            LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
-
-            resultSet = getConnection().getMetaData().getColumns(null, null, tableName, columnName);
-            result = resultSet.next();
-            resultSet.close();
-            resultSet = null;
-
-            return result;
+    	LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
 
+        try (ResultSet resultSet = getConnection().getMetaData().getColumns(null, null, tableName, columnName)) {
+        	return resultSet.next();
         } catch (SQLException e) {
-            throw new OsmosisRuntimeException("Unable to check for the existence of column " + tableName + "."
-                    + columnName + ".", e);
-        } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close column existence result set.", e);
-                }
-            }
+        	throw new OsmosisRuntimeException("Unable to check for the existence of column " + tableName + "."
+                  + columnName + ".", e);
         }
     }
 
@@ -535,30 +529,14 @@ public class DatabaseContext {
      * @return True if the table exists, false otherwise.
      */
     public boolean doesTableExist(String tableName) {
-        ResultSet resultSet = null;
-        boolean result;
-
-        try {
+        try (ResultSet resultSet =
+                     getConnection().getMetaData().getTables(null, null, tableName, new String[] {"TABLE"})) {
             LOG.finest("Checking if table {" + tableName + "} exists.");
 
-            resultSet = getConnection().getMetaData().getTables(null, null, tableName, new String[] {"TABLE"});
-            result = resultSet.next();
-            resultSet.close();
-            resultSet = null;
-
-            return result;
+            return resultSet.next();
 
         } catch (SQLException e) {
             throw new OsmosisRuntimeException("Unable to check for the existence of table " + tableName + ".", e);
-        } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close table existence result set.", e);
-                }
-            }
         }
     }
 
@@ -570,7 +548,7 @@ public class DatabaseContext {
      */
     @Override
     protected void finalize() throws Throwable {
-        release();
+        close();
 
         super.finalize();
     }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext2.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext2.java
index d382d80..1bbc101 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext2.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/DatabaseContext2.java
@@ -26,7 +26,7 @@ import org.springframework.transaction.support.TransactionTemplate;
  * 
  * @author Brett Henderson
  */
-public class DatabaseContext2 {
+public class DatabaseContext2 implements AutoCloseable {
 
     private static final Logger LOG = Logger.getLogger(DatabaseContext.class.getName());
 
@@ -60,9 +60,14 @@ public class DatabaseContext2 {
             identityValueLoader = new MysqlIdentityValueLoader2(this);
             break;
         default:
-            throw new OsmosisRuntimeException("Unknown database type " + loginCredentials.getDbType() + ".");
+			throw createUnknownDbTypeException();
         }
     }
+
+
+	private OsmosisRuntimeException createUnknownDbTypeException() {
+		return new OsmosisRuntimeException("Unknown database type " + dbType + ".");
+	}
     
     
     /**
@@ -110,7 +115,7 @@ public class DatabaseContext2 {
         	jdbcTemplate.setFetchSize(Integer.MIN_VALUE);
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + dbType + ".");
+			throw createUnknownDbTypeException();
 		}
     }
 	
@@ -144,7 +149,7 @@ public class DatabaseContext2 {
 			}
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + dbType + ".");
+			throw createUnknownDbTypeException();
 		}
 	}
 	
@@ -166,7 +171,7 @@ public class DatabaseContext2 {
 			}
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + dbType + ".");
+			throw createUnknownDbTypeException();
 		}
 	}
 	
@@ -188,7 +193,7 @@ public class DatabaseContext2 {
 			}
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + dbType + ".");
+			throw createUnknownDbTypeException();
 		}
 	}
 	
@@ -220,7 +225,7 @@ public class DatabaseContext2 {
         	jdbcTemplate.update(statementBuilder.toString());
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + dbType + ".");
+			throw createUnknownDbTypeException();
 		}
 	}
 	
@@ -240,7 +245,7 @@ public class DatabaseContext2 {
         	jdbcTemplate.update("UNLOCK TABLES");
 			break;
 		default:
-			throw new OsmosisRuntimeException("Unknown database type " + dbType + ".");
+			throw createUnknownDbTypeException();
 		}
 	}
 
@@ -271,9 +276,20 @@ public class DatabaseContext2 {
     /**
      * Releases all database resources. This method is guaranteed not to throw transactions and
      * should always be called in a finally block whenever this class is used.
+     * 
+     * @deprecated Use {@link #close()} instead.
      */
     public void release() {
-    	identityValueLoader.release();
+    	close();
+    }
+    
+    
+    /**
+     * Releases all database resources. This method is guaranteed not to throw transactions and
+     * should always be called in a finally or try-with-resources block whenever this class is used.
+     */
+    public void close() {
+    	identityValueLoader.close();
     	
     	try {
 			dataSource.close();
@@ -290,42 +306,23 @@ public class DatabaseContext2 {
      * @param columnName The column to check for.
      * @return True if the column exists, false otherwise.
      */
-    public boolean doesColumnExist(String tableName, String columnName) {
-        ResultSet resultSet = null;
-        boolean result;
-
-        try {
-        	Connection connection;
-        	
-            LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
-
-            // This connection may not be freed if an exception occurs. It's a small chance and the
-			// additional code to avoid it is cumbersome.
-            connection = DataSourceUtils.getConnection(dataSource);
-            
-            resultSet = connection.getMetaData().getColumns(null, null, tableName, columnName);
-            result = resultSet.next();
-            resultSet.close();
-            resultSet = null;
-            
-            DataSourceUtils.releaseConnection(connection, dataSource);
+	public boolean doesColumnExist(String tableName, String columnName) {
+		Connection connection;
 
-            return result;
+		LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
 
-        } catch (SQLException e) {
-            throw new OsmosisRuntimeException("Unable to check for the existence of column " + tableName + "."
-                    + columnName + ".", e);
-        } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close column existence result set.", e);
-                }
-            }
-        }
-    }
+		connection = DataSourceUtils.getConnection(dataSource);
+		try {
+			try (ResultSet resultSet = connection.getMetaData().getColumns(null, null, tableName, columnName)) {
+				return resultSet.next();
+			} catch (SQLException e) {
+				throw new OsmosisRuntimeException("Unable to check for the existence of column " + tableName + "."
+						+ columnName + ".", e);
+			}
+		} finally {
+			DataSourceUtils.releaseConnection(connection, dataSource);
+		}
+	}
 
     /**
      * Indicates if the specified table exists in the database.
@@ -334,39 +331,19 @@ public class DatabaseContext2 {
      * @return True if the table exists, false otherwise.
      */
     public boolean doesTableExist(String tableName) {
-        ResultSet resultSet = null;
-        boolean result;
-
-        try {
-        	Connection connection;
-        	
-            LOG.finest("Checking if table {" + tableName + "} exists.");
-
-            // This connection may not be freed if an exception occurs. It's a small chance and the
-			// additional code to avoid it is cumbersome.
-            connection = DataSourceUtils.getConnection(dataSource);
-
-            resultSet = connection.getMetaData().getTables(null, null, tableName, new String[] {"TABLE"});
-            result = resultSet.next();
-            resultSet.close();
-            resultSet = null;
-            
-            DataSourceUtils.releaseConnection(connection, dataSource);
+    	Connection connection;
 
-            return result;
+    	LOG.finest("Checking if table {" + tableName + "} exists.");
 
-        } catch (SQLException e) {
-            throw new OsmosisRuntimeException("Unable to check for the existence of table " + tableName + ".", e);
-        } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close table existence result set.", e);
-                }
-            }
-        }
+    	connection = DataSourceUtils.getConnection(dataSource);
+		try (ResultSet resultSet =
+					 connection.getMetaData().getTables(null, null, tableName, new String[] {"TABLE"})) {
+			return resultSet.next();
+		} catch (SQLException e) {
+			throw new OsmosisRuntimeException("Unable to check for the existence of table " + tableName + ".", e);
+		} finally {
+			DataSourceUtils.releaseConnection(connection, dataSource);
+		}
     }
 
     /**
@@ -377,7 +354,7 @@ public class DatabaseContext2 {
      */
     @Override
     protected void finalize() throws Throwable {
-        release();
+        close();
 
         super.finalize();
     }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/IdentityValueLoader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/IdentityValueLoader.java
index bd8a722..2278fb7 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/IdentityValueLoader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/IdentityValueLoader.java
@@ -1,7 +1,7 @@
 // This software is released into the Public Domain.  See copying.txt for details.
 package org.openstreetmap.osmosis.apidb.common;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -11,7 +11,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public interface IdentityValueLoader extends Releasable {
+public interface IdentityValueLoader extends Closeable {
 
 	/**
 	 * Returns the id of the most recently inserted row on the current
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader.java
index 0706d88..6fc8839 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader.java
@@ -4,8 +4,6 @@ package org.openstreetmap.osmosis.apidb.common;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
@@ -17,7 +15,6 @@ import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
  * @author Brett Henderson
  */
 public class MysqlIdentityValueLoader implements IdentityValueLoader {
-	private static final Logger LOG = Logger.getLogger(MysqlIdentityValueLoader.class.getName());
 	private static final String SQL_SELECT_LAST_INSERT_ID =
 		"SELECT LAST_INSERT_ID() AS lastInsertId FROM DUAL";
 	
@@ -46,41 +43,16 @@ public class MysqlIdentityValueLoader implements IdentityValueLoader {
 	 * @return The newly inserted id.
 	 */
 	public long getLastInsertId() {
-		ResultSet lastInsertQuery;
-		
 		if (selectInsertIdStatement == null) {
-			selectInsertIdStatement =
-				statementContainer.add(dbCtx.prepareStatementForStreaming(SQL_SELECT_LAST_INSERT_ID));
+			selectInsertIdStatement = statementContainer.add(dbCtx
+					.prepareStatementForStreaming(SQL_SELECT_LAST_INSERT_ID));
 		}
-		
-		lastInsertQuery = null;
-		try {
-			long lastInsertId;
-			
-			lastInsertQuery = selectInsertIdStatement.executeQuery();
-			
+
+		try (ResultSet lastInsertQuery = selectInsertIdStatement.executeQuery()) {
 			lastInsertQuery.next();
-			lastInsertId = lastInsertQuery.getLong("lastInsertId");
-			
-			lastInsertQuery.close();
-			lastInsertQuery = null;
-			
-			return lastInsertId;
-			
+			return lastInsertQuery.getLong("lastInsertId");
 		} catch (SQLException e) {
-			throw new OsmosisRuntimeException(
-				"Unable to retrieve the id of the newly inserted record.",
-				e
-			);
-		} finally {
-			if (lastInsertQuery != null) {
-				try {
-					lastInsertQuery.close();
-				} catch (SQLException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close last insert query.", e);
-				}
-			}
+			throw new OsmosisRuntimeException("Unable to retrieve the id of the newly inserted record.", e);
 		}
 	}
 
@@ -98,7 +70,7 @@ public class MysqlIdentityValueLoader implements IdentityValueLoader {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		statementContainer.release();
+	public void close() {
+		statementContainer.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader2.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader2.java
index d5c8b47..001f888 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader2.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader2.java
@@ -49,7 +49,7 @@ public class MysqlIdentityValueLoader2 implements IdentityValueLoader {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader.java
index bb674d9..74db678 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader.java
@@ -4,8 +4,6 @@ package org.openstreetmap.osmosis.apidb.common;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
@@ -17,7 +15,6 @@ import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
  * @author Brett Henderson
  */
 public class PostgresqlIdentityValueLoader implements IdentityValueLoader {
-	private static final Logger LOG = Logger.getLogger(PostgresqlIdentityValueLoader.class.getName());
 	private static final String SQL_SELECT_LAST_INSERT_ID =
 		"SELECT lastval() AS lastInsertId";
 	private static final String SQL_SELECT_LAST_SEQUENCE_ID =
@@ -49,41 +46,20 @@ public class PostgresqlIdentityValueLoader implements IdentityValueLoader {
 	 * @return The newly inserted id.
 	 */
 	public long getLastInsertId() {
-		ResultSet lastInsertQuery;
-		
 		if (selectInsertIdStatement == null) {
 			selectInsertIdStatement =
 				statementContainer.add(dbCtx.prepareStatementForStreaming(SQL_SELECT_LAST_INSERT_ID));
 		}
 		
-		lastInsertQuery = null;
-		try {
-			long lastInsertId;
-			
-			lastInsertQuery = selectInsertIdStatement.executeQuery();
-			
+		try (ResultSet lastInsertQuery = selectInsertIdStatement.executeQuery()) {
 			lastInsertQuery.next();
-			lastInsertId = lastInsertQuery.getLong("lastInsertId");
-			
-			lastInsertQuery.close();
-			lastInsertQuery = null;
-			
-			return lastInsertId;
+			return lastInsertQuery.getLong("lastInsertId");
 			
 		} catch (SQLException e) {
 			throw new OsmosisRuntimeException(
 				"Unable to retrieve the id of the newly inserted record.",
 				e
 			);
-		} finally {
-			if (lastInsertQuery != null) {
-				try {
-					lastInsertQuery.close();
-				} catch (SQLException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close last insert query.", e);
-				}
-			}
 		}
 	}
 
@@ -93,42 +69,20 @@ public class PostgresqlIdentityValueLoader implements IdentityValueLoader {
 	 */
 	@Override
 	public long getLastSequenceId(String sequenceName) {
-		ResultSet lastSequenceQuery;
-		
 		if (selectSequenceIdStatement == null) {
 			selectSequenceIdStatement =
 				statementContainer.add(dbCtx.prepareStatementForStreaming(SQL_SELECT_LAST_SEQUENCE_ID));
 		}
-		
-		lastSequenceQuery = null;
+
 		try {
-			long lastSequenceId;
-			
 			selectSequenceIdStatement.setString(1, sequenceName);
-			lastSequenceQuery = selectSequenceIdStatement.executeQuery();
-			
-			lastSequenceQuery.next();
-			lastSequenceId = lastSequenceQuery.getLong("lastSequenceId");
-			
-			lastSequenceQuery.close();
-			lastSequenceQuery = null;
-			
-			return lastSequenceId;
-			
-		} catch (SQLException e) {
-			throw new OsmosisRuntimeException(
-				"Unable to retrieve the last sequence id.",
-				e
-			);
-		} finally {
-			if (lastSequenceQuery != null) {
-				try {
-					lastSequenceQuery.close();
-				} catch (SQLException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close last sequence query.", e);
-				}
+			try (ResultSet lastSequenceQuery = selectSequenceIdStatement.executeQuery()) {
+
+				lastSequenceQuery.next();
+				return lastSequenceQuery.getLong("lastSequenceId");
 			}
+		} catch (SQLException e) {
+			throw new OsmosisRuntimeException("Unable to retrieve the last sequence id.", e);
 		}
 	}
 	
@@ -137,7 +91,7 @@ public class PostgresqlIdentityValueLoader implements IdentityValueLoader {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		statementContainer.release();
+	public void close() {
+		statementContainer.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader2.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader2.java
index 24d341f..7e9ba24 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader2.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader2.java
@@ -51,7 +51,7 @@ public class PostgresqlIdentityValueLoader2 implements IdentityValueLoader {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeReader.java
index e0aa7af..544aa7e 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeReader.java
@@ -75,32 +75,32 @@ public class ApidbChangeReader implements RunnableChangeSource {
     protected void runImpl(DatabaseContext2 dbCtx) {
     	try {
     		AllEntityDao entityDao;
-    		ReleasableIterator<ChangeContainer> reader;
-    		
+
     		changeSink.initialize(Collections.<String, Object>emptyMap());
-    		
+
 	        new SchemaVersionValidator(loginCredentials, preferences)
 	                .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
-	        
+
 	        entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());
-	        
-	        reader = entityDao.getHistory(intervalBegin, intervalEnd);
-	        if (!fullHistory) {
-	        	reader = new DeltaToDiffReader(reader);
-	        }
-	        try {
-	        	while (reader.hasNext()) {
-	        		changeSink.process(reader.next());
-	        	}
+
+	        try (ReleasableIterator<ChangeContainer> reader = entityDao.getHistory(intervalBegin, intervalEnd)) {
+	        	ReleasableIterator<ChangeContainer> i;
 	        	
-	        } finally {
-	        	reader.release();
+	        	if (fullHistory) {
+	        		i = reader;
+	        	} else {
+	        		i = new DeltaToDiffReader(reader);
+	        	}
+
+	        	while (i.hasNext()) {
+	        		changeSink.process(i.next());
+	        	}
 	        }
 	
 	        changeSink.complete();
 	        
     	} finally {
-    		changeSink.release();
+    		changeSink.close();
     	}
     }
     
@@ -109,19 +109,13 @@ public class ApidbChangeReader implements RunnableChangeSource {
      * Reads all data from the database and send it to the sink.
      */
     public void run() {
-        final DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials);
-    	
-        try {
+        try (DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials)) {
         	dbCtx.executeWithinTransaction(new TransactionCallbackWithoutResult() {
-        		private DatabaseContext2 dbCtxInner = dbCtx;
-
 				@Override
 				protected void doInTransactionWithoutResult(TransactionStatus arg0) {
-					runImpl(dbCtxInner);
+					runImpl(dbCtx);
 				} });
 
-        } finally {
-            dbCtx.release();
         }
     }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeWriter.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeWriter.java
index f209a59..373a43d 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeWriter.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbChangeWriter.java
@@ -84,7 +84,7 @@ public class ApidbChangeWriter implements ChangeSink {
     /**
      * {@inheritDoc}
      */
-    public void release() {
-        changeWriter.release();
+    public void close() {
+        changeWriter.close();
     }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbCurrentReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbCurrentReader.java
index 9c95da5..b2c8aa9 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbCurrentReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbCurrentReader.java
@@ -63,7 +63,6 @@ public class ApidbCurrentReader implements RunnableSource {
     protected void runImpl(DatabaseContext2 dbCtx) {
     	try {
     		AllEntityDao entityDao;
-    		ReleasableIterator<EntityContainer> reader;
     		
     		sink.initialize(Collections.<String, Object>emptyMap());
     		
@@ -73,20 +72,16 @@ public class ApidbCurrentReader implements RunnableSource {
 	        entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());
 	        
 	        sink.process(new BoundContainer(new Bound("Osmosis " + OsmosisConstants.VERSION)));
-	        reader = entityDao.getCurrent();
-	        try {
+	        try (ReleasableIterator<EntityContainer> reader = entityDao.getCurrent()) {
 	        	while (reader.hasNext()) {
 	        		sink.process(reader.next());
 	        	}
-	        	
-	        } finally {
-	        	reader.release();
 	        }
 	
 	        sink.complete();
 	        
     	} finally {
-    		sink.release();
+    		sink.close();
     	}
     }
     
@@ -95,19 +90,13 @@ public class ApidbCurrentReader implements RunnableSource {
      * Reads all data from the database and send it to the sink.
      */
     public void run() {
-        final DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials);
-    	
-        try {
+        try (DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials)) {
         	dbCtx.executeWithinTransaction(new TransactionCallbackWithoutResult() {
-        		private DatabaseContext2 dbCtxInner = dbCtx;
 
 				@Override
 				protected void doInTransactionWithoutResult(TransactionStatus arg0) {
-					runImpl(dbCtxInner);
+					runImpl(dbCtx);
 				} });
-
-        } finally {
-            dbCtx.release();
         }
     }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbFileReplicator.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbFileReplicator.java
index 0d42d8b..73944e2 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbFileReplicator.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbFileReplicator.java
@@ -95,13 +95,8 @@ public class ApidbFileReplicator implements RunnableChangeSource {
 	 */
 	@Override
 	public void run() {
-        final DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials);
-    	
-        try {
+        try (DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials)) {
         	runImpl(dbCtx);
-
-        } finally {
-            dbCtx.release();
         }
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbReader.java
index 6b63b69..5e0f5db 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbReader.java
@@ -67,7 +67,6 @@ public class ApidbReader implements RunnableSource {
     protected void runImpl(DatabaseContext2 dbCtx) {
     	try {
     		AllEntityDao entityDao;
-    		ReleasableIterator<EntityContainer> reader;
     		
     		sink.initialize(Collections.<String, Object>emptyMap());
     		
@@ -77,20 +76,17 @@ public class ApidbReader implements RunnableSource {
 	        entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());
 
 	        sink.process(new BoundContainer(new Bound("Osmosis " + OsmosisConstants.VERSION)));
-	        reader = new EntitySnapshotReader(entityDao.getHistory(), snapshotInstant);
-	        try {
+	        try (ReleasableIterator<EntityContainer> reader =
+                         new EntitySnapshotReader(entityDao.getHistory(), snapshotInstant)) {
 	        	while (reader.hasNext()) {
 	        		sink.process(reader.next());
 	        	}
-	        	
-	        } finally {
-	        	reader.release();
 	        }
 	
 	        sink.complete();
 	        
     	} finally {
-    		sink.release();
+    		sink.close();
     	}
     }
     
@@ -99,19 +95,13 @@ public class ApidbReader implements RunnableSource {
      * Reads all data from the database and send it to the sink.
      */
     public void run() {
-        final DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials);
-    	
-        try {
+        try (DatabaseContext2 dbCtx = new DatabaseContext2(loginCredentials)) {
         	dbCtx.executeWithinTransaction(new TransactionCallbackWithoutResult() {
-        		private DatabaseContext2 dbCtxInner = dbCtx;
-
 				@Override
 				protected void doInTransactionWithoutResult(TransactionStatus arg0) {
-					runImpl(dbCtxInner);
-				} });
-
-        } finally {
-            dbCtx.release();
+					runImpl(dbCtx);
+				}
+        	});
         }
     }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbTruncator.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbTruncator.java
index a94e945..88f7cc1 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbTruncator.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbTruncator.java
@@ -28,7 +28,7 @@ public class ApidbTruncator implements RunnableTask {
 			"way_nodes", "way_tags", "ways", "node_tags", "nodes",
 			"changeset_tags", "changesets", "users"});
 
-	private final DatabaseContext dbCtx;
+	private DatabaseLoginCredentials loginCredentials;
 
 	private final SchemaVersionValidator schemaVersionValidator;
 
@@ -42,7 +42,7 @@ public class ApidbTruncator implements RunnableTask {
 	 *            Contains preferences configuring database behaviour.
 	 */
 	public ApidbTruncator(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences) {
-		dbCtx = new DatabaseContext(loginCredentials);
+		this.loginCredentials = loginCredentials;
 
 		schemaVersionValidator = new SchemaVersionValidator(loginCredentials, preferences);
 	}
@@ -52,15 +52,12 @@ public class ApidbTruncator implements RunnableTask {
 	 * Truncates all data from the database.
 	 */
 	public void run() {
-		try {
+		try (DatabaseContext dbCtx = new DatabaseContext(loginCredentials)) {
 			schemaVersionValidator.validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
 
 			dbCtx.truncateTables(TRUNCATE_TABLES);
 			
 			dbCtx.commit();
-
-		} finally {
-			dbCtx.release();
 		}
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbVersionConstants.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbVersionConstants.java
index 92e0f3a..73739a5 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbVersionConstants.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbVersionConstants.java
@@ -10,12 +10,6 @@ package org.openstreetmap.osmosis.apidb.v0_6;
 public final class ApidbVersionConstants {
 	
 	/**
-	 * This class cannot be instantiated.
-	 */
-	private ApidbVersionConstants() {
-	}
-	
-	/**
 	 * Defines the schema migrations expected to be in the database.
 	 */
 	public static final String[] SCHEMA_MIGRATIONS = {
@@ -24,8 +18,8 @@ public final class ApidbVersionConstants {
 		"21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
 		"31", "32", "33", "34", "35", "36", "37", "38", "39", "40",
 		"41", "42", "43", "44", "45", "46", "47", "48", "49", "50",
-		"51", "52", "53", "54", "55", "56", "57", "20100513171259", 
-		"20100516124737", "20100910084426", "20101114011429", 
+		"51", "52", "53", "54", "55", "56", "57", "20100513171259",
+		"20100516124737", "20100910084426", "20101114011429",
 		"20110322001319", "20110508145337", "20110521142405",
 		"20110925112722", "20111116184519", "20111212183945",
 		"20120123184321", "20120208122334", "20120208194454",
@@ -34,4 +28,10 @@ public final class ApidbVersionConstants {
 		"20121005195010", "20121012044047", "20121119165817",
 		"20121202155309", "20121203124841", "20130328184137"
 	};
+
+	/**
+	 * This class cannot be instantiated.
+	 */
+	private ApidbVersionConstants() {
+	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java
index ae651f9..51976cf 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java
@@ -50,25 +50,25 @@ public class ApidbWriter implements Sink, EntityProcessor {
     // on how many rows of data are to be inserted at a time.
 	private static final String INSERT_SQL_NODE_COLUMNS =
 		"INSERT INTO nodes(node_id, timestamp, version, visible, changeset_id, latitude, longitude, tile)";
-	private static final String INSERT_SQL_NODE_PARAMS = "?, ?, ?, ?, ?, ?, ?, ?";
+	private static final String INSERT_SQL_NODE_PARAMS = createParamPlaceholders(8);
 	private static final int INSERT_PRM_COUNT_NODE = 8;
 
     private static final String INSERT_SQL_NODE_TAG_COLUMNS = "INSERT INTO node_tags (node_id, k, v, version)";
-    private static final String INSERT_SQL_NODE_TAG_PARAMS = "?, ?, ?, ?";
+    private static final String INSERT_SQL_NODE_TAG_PARAMS = createParamPlaceholders(4);
 	private static final int INSERT_PRM_COUNT_NODE_TAG = 4;
 
     private static final String INSERT_SQL_WAY_COLUMNS =
     	"INSERT INTO ways (way_id, timestamp, version, visible, changeset_id)";
-    private static final String INSERT_SQL_WAY_PARAMS = "?, ?, ?, ?, ?";
+    private static final String INSERT_SQL_WAY_PARAMS = createParamPlaceholders(5);
 	private static final int INSERT_PRM_COUNT_WAY = 5;
 
     private static final String INSERT_SQL_WAY_TAG_COLUMNS = "INSERT INTO way_tags (way_id, k, v, version)";
-    private static final String INSERT_SQL_WAY_TAG_PARAMS = "?, ?, ?, ?";
+    private static final String INSERT_SQL_WAY_TAG_PARAMS = createParamPlaceholders(4);
 	private static final int INSERT_PRM_COUNT_WAY_TAG = 4;
 
     private static final String INSERT_SQL_WAY_NODE_COLUMNS =
     	"INSERT INTO way_nodes (way_id, node_id, sequence_id, version)";
-    private static final String INSERT_SQL_WAY_NODE_PARAMS = "?, ?, ?, ?";
+    private static final String INSERT_SQL_WAY_NODE_PARAMS = createParamPlaceholders(4);
 	private static final int INSERT_PRM_COUNT_WAY_NODE = 4;
 
     private static final String INSERT_SQL_RELATION_COLUMNS =
@@ -79,7 +79,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
     private static final String INSERT_SQL_RELATION_TAG_COLUMNS =
         "INSERT INTO relation_tags (relation_id, k, v, version)";
-    private static final String INSERT_SQL_RELATION_TAG_PARAMS = "?, ?, ?, ?";
+    private static final String INSERT_SQL_RELATION_TAG_PARAMS = createParamPlaceholders(4);
 	private static final int INSERT_PRM_COUNT_RELATION_TAG = 4;
 
     private static final String INSERT_SQL_RELATION_MEMBER_COLUMNS =
@@ -111,17 +111,19 @@ public class ApidbWriter implements Sink, EntityProcessor {
     private static final String LOAD_CURRENT_NODE_TAGS =
     	"INSERT INTO current_node_tags SELECT node_id, k, v FROM node_tags WHERE node_id >= ? AND node_id < ?";
 
+    private static final String WHERE_WAY_ID_IN_RANGE = " WHERE way_id >= ? AND way_id < ?";
+
     private static final String LOAD_CURRENT_WAYS =
     	"INSERT INTO current_ways SELECT way_id, changeset_id, timestamp, visible, version FROM ways"
-            + " WHERE way_id >= ? AND way_id < ?";
+            + WHERE_WAY_ID_IN_RANGE;
 
     private static final String LOAD_CURRENT_WAY_TAGS =
     	"INSERT INTO current_way_tags SELECT way_id, k, v FROM way_tags"
-            + " WHERE way_id >= ? AND way_id < ?";
+            + WHERE_WAY_ID_IN_RANGE;
 
     private static final String LOAD_CURRENT_WAY_NODES =
     	"INSERT INTO current_way_nodes SELECT way_id, node_id, sequence_id FROM way_nodes"
-            + " WHERE way_id >= ? AND way_id < ?";
+            + WHERE_WAY_ID_IN_RANGE;
 
     private static final String LOAD_CURRENT_RELATIONS =
     	"INSERT INTO current_relations SELECT relation_id, changeset_id, timestamp, visible, version"
@@ -152,39 +154,6 @@ public class ApidbWriter implements Sink, EntityProcessor {
     private static final int INSERT_BULK_ROW_COUNT_RELATION = 100;
     private static final int INSERT_BULK_ROW_COUNT_RELATION_TAG = 100;
     private static final int INSERT_BULK_ROW_COUNT_RELATION_MEMBER = 100;
-
-    /**
-	 * Builds a multi-row SQL insert statement.
-	 * 
-	 * @param columnSql
-	 *            The basic query without value bind variables.
-	 * @param parametersSql
-	 *            The SQL parameters portion of the query.
-	 * @param rowCount
-	 *            The number of rows to insert in a single query.
-	 * @return The generated SQL statement.
-	 */
-    private static String buildSqlInsertStatement(String columnSql, String parametersSql, int rowCount) {
-        StringBuilder buffer;
-
-        buffer = new StringBuilder();
-
-        buffer.append(columnSql).append(" VALUES ");
-
-        for (int i = 0; i < rowCount; i++) {
-            if (i > 0) {
-                buffer.append(", ");
-            }
-            
-            buffer.append("(");
-            buffer.append(parametersSql);
-            buffer.append(")");
-        }
-
-        return buffer.toString();
-    }
-
-    
     private String insertSqlSingleNode;
     private String insertSqlBulkNode;
     private String insertSqlSingleNodeTag;
@@ -251,7 +220,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
     /**
      * Creates a new instance.
-     * 
+     *
      * @param loginCredentials Contains all information required to connect to the database.
      * @param preferences Contains preferences configuring database behaviour.
      * @param lockTables If true, all tables will be locked during loading.
@@ -261,7 +230,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
     public ApidbWriter(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences, boolean lockTables,
             boolean populateCurrentTables) {
         dbCtx = new DatabaseContext(loginCredentials);
-        
+
         userManager = new UserManager(dbCtx);
         changesetManager = new ChangesetManager(dbCtx);
 
@@ -291,7 +260,37 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
         initialized = false;
     }
-    
+
+    /**
+     * Builds a multi-row SQL insert statement.
+     *
+     * @param columnSql
+     *            The basic query without value bind variables.
+     * @param parametersSql
+     *            The SQL parameters portion of the query.
+     * @param rowCount
+     *            The number of rows to insert in a single query.
+     * @return The generated SQL statement.
+     */
+    private static String buildSqlInsertStatement(String columnSql, String parametersSql, int rowCount) {
+        StringBuilder buffer;
+
+        buffer = new StringBuilder();
+
+        buffer.append(columnSql).append(" VALUES ");
+
+        for (int i = 0; i < rowCount; i++) {
+            if (i > 0) {
+                buffer.append(", ");
+            }
+
+            buffer.append("(");
+            buffer.append(parametersSql);
+            buffer.append(")");
+        }
+
+        return buffer.toString();
+    }
     
     private void buildSqlStatements() {
     	insertSqlSingleNode = buildSqlInsertStatement(INSERT_SQL_NODE_COLUMNS, INSERT_SQL_NODE_PARAMS, 1);
@@ -320,7 +319,12 @@ public class ApidbWriter implements Sink, EntityProcessor {
 		insertSqlBulkRelationTag = buildSqlInsertStatement(INSERT_SQL_RELATION_TAG_COLUMNS,
 				INSERT_SQL_RELATION_TAG_PARAMS, INSERT_BULK_ROW_COUNT_RELATION_TAG);
     }
-    
+
+
+    private OsmosisRuntimeException createUnknownDbTypeException() {
+        return new OsmosisRuntimeException("Unknown database type " + dbCtx.getDatabaseType() + ".");
+    }
+
 
     /**
      * Initialises prepared statements and obtains database locks. Can be called multiple times.
@@ -328,9 +332,9 @@ public class ApidbWriter implements Sink, EntityProcessor {
     private void initialize() {
         if (!initialized) {
             schemaVersionValidator.validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
-            
+
             buildSqlStatements();
-            
+
             switch (dbCtx.getDatabaseType()) {
             case POSTGRESQL:
     			insertSqlSingleRelationMember = buildSqlInsertStatement(INSERT_SQL_RELATION_MEMBER_COLUMNS,
@@ -345,7 +349,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
     					INSERT_SQL_RELATION_MEMBER_PARAMS_MYSQL, INSERT_BULK_ROW_COUNT_RELATION_MEMBER);
                 break;
             default:
-                throw new OsmosisRuntimeException("Unknown database type " + dbCtx.getDatabaseType() + ".");
+                throw createUnknownDbTypeException();
             }
 
             bulkNodeStatement = dbCtx.prepareStatement(insertSqlBulkNode);
@@ -386,9 +390,16 @@ public class ApidbWriter implements Sink, EntityProcessor {
         }
     }
 
+    private void assertEntityHasTimestamp(Entity entity) {
+        if (entity.getTimestamp() == null) {
+            throw new OsmosisRuntimeException(
+                    entity.getType().toString() + " " + entity.getId() + " does not have a timestamp set.");
+        }
+    }
+
     /**
      * Sets node values as bind variable parameters to a node insert query.
-     * 
+     *
      * @param statement The prepared statement to add the values to.
      * @param initialIndex The offset index of the first variable to set.
      * @param node The node containing the data to be inserted.
@@ -398,10 +409,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
         prmIndex = initialIndex;
 
-        // We can't write an entity with a null timestamp.
-        if (node.getTimestamp() == null) {
-            throw new OsmosisRuntimeException("Node " + node.getId() + " does not have a timestamp set.");
-        }
+        assertEntityHasTimestamp(node);
 
         try {
             statement.setLong(prmIndex++, node.getId());
@@ -418,9 +426,20 @@ public class ApidbWriter implements Sink, EntityProcessor {
         }
     }
 
+    private static String createParamPlaceholders(int amount) {
+        StringBuilder questionMarks = new StringBuilder();
+        for (int i = 0; i < amount; i++) {
+            questionMarks.append("?");
+            if (i != amount - 1) {
+                questionMarks.append(", ");
+            }
+        }
+        return questionMarks.toString();
+    }
+
     /**
      * Sets way values as bind variable parameters to a way insert query.
-     * 
+     *
      * @param statement The prepared statement to add the values to.
      * @param initialIndex The offset index of the first variable to set.
      * @param way The way containing the data to be inserted.
@@ -430,10 +449,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
         prmIndex = initialIndex;
 
-        // We can't write an entity with a null timestamp.
-        if (way.getTimestamp() == null) {
-            throw new OsmosisRuntimeException("Way " + way.getId() + " does not have a timestamp set.");
-        }
+        assertEntityHasTimestamp(way);
 
         try {
             statement.setLong(prmIndex++, way.getId());
@@ -449,7 +465,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
     /**
      * Sets tag values as bind variable parameters to a tag insert query.
-     * 
+     *
      * @param statement The prepared statement to add the values to.
      * @param initialIndex The offset index of the first variable to set.
      * @param dbEntityTag The entity tag containing the data to be inserted.
@@ -476,7 +492,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
     /**
      * Sets node reference values as bind variable parameters to a way node insert query.
-     * 
+     *
      * @param statement The prepared statement to add the values to.
      * @param initialIndex The offset index of the first variable to set.
      * @param dbWayNode The way node containing the data to be inserted.
@@ -500,7 +516,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
     /**
      * Sets relation values as bind variable parameters to a relation insert query.
-     * 
+     *
      * @param statement The prepared statement to add the values to.
      * @param initialIndex The offset index of the first variable to set.
      * @param relation The way containing the data to be inserted.
@@ -510,10 +526,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
         prmIndex = initialIndex;
 
-        // We can't write an entity with a null timestamp.
-        if (relation.getTimestamp() == null) {
-            throw new OsmosisRuntimeException("Relation " + relation.getId() + " does not have a timestamp set.");
-        }
+        assertEntityHasTimestamp(relation);
 
         try {
             statement.setLong(prmIndex++, relation.getId());
@@ -529,7 +542,7 @@ public class ApidbWriter implements Sink, EntityProcessor {
 
     /**
      * Sets member reference values as bind variable parameters to a relation member insert query.
-     * 
+     *
      * @param statement The prepared statement to add the values to.
      * @param initialIndex The offset index of the first variable to set.
      * @param dbRelationMember The relation member containing the data to be inserted.
@@ -1080,10 +1093,10 @@ public class ApidbWriter implements Sink, EntityProcessor {
     /**
      * Releases all database resources.
      */
-    public void release() {
-        userManager.release();
+    public void close() {
+        userManager.close();
 
-        dbCtx.release();
+        dbCtx.close();
     }
 
     /**
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/AllEntityDao.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/AllEntityDao.java
index f52b18e..bdc4b71 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/AllEntityDao.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/AllEntityDao.java
@@ -44,10 +44,7 @@ public class AllEntityDao implements ReplicationSource {
 	 * @return An iterator pointing at the identified records.
 	 */
 	public ReleasableIterator<ChangeContainer> getHistory(ReplicationQueryPredicates predicates) {
-		ReleasableContainer releasableContainer;
-		
-		releasableContainer = new ReleasableContainer();
-		try {
+		try (ReleasableContainer releasableContainer = new ReleasableContainer()) {
 			List<ReleasableIterator<ChangeContainer>> sources;
 			MultipleSourceIterator<ChangeContainer> resultIterator;
 			
@@ -61,9 +58,6 @@ public class AllEntityDao implements ReplicationSource {
 			releasableContainer.clear();
 			
 			return resultIterator;
-			
-		} finally {
-			releasableContainer.release();
 		}
 	}
 	
@@ -78,10 +72,7 @@ public class AllEntityDao implements ReplicationSource {
 	 * @return An iterator pointing at the identified records.
 	 */
 	public ReleasableIterator<ChangeContainer> getHistory(Date intervalBegin, Date intervalEnd) {
-		ReleasableContainer releasableContainer;
-		
-		releasableContainer = new ReleasableContainer();
-		try {
+		try (ReleasableContainer releasableContainer = new ReleasableContainer()) {
 			List<ReleasableIterator<ChangeContainer>> sources;
 			MultipleSourceIterator<ChangeContainer> resultIterator;
 			
@@ -95,9 +86,6 @@ public class AllEntityDao implements ReplicationSource {
 			releasableContainer.clear();
 			
 			return resultIterator;
-			
-		} finally {
-			releasableContainer.release();
 		}
 	}
 	
@@ -108,10 +96,7 @@ public class AllEntityDao implements ReplicationSource {
 	 * @return An iterator pointing at the identified records.
 	 */
 	public ReleasableIterator<ChangeContainer> getHistory() {
-		ReleasableContainer releasableContainer;
-		
-		releasableContainer = new ReleasableContainer();
-		try {
+		try (ReleasableContainer releasableContainer = new ReleasableContainer()) {
 			List<ReleasableIterator<ChangeContainer>> sources;
 			MultipleSourceIterator<ChangeContainer> resultIterator;
 			
@@ -125,9 +110,6 @@ public class AllEntityDao implements ReplicationSource {
 			releasableContainer.clear();
 			
 			return resultIterator;
-			
-		} finally {
-			releasableContainer.release();
 		}
 	}
 	
@@ -138,10 +120,7 @@ public class AllEntityDao implements ReplicationSource {
 	 * @return An iterator pointing at the current records.
 	 */
 	public ReleasableIterator<EntityContainer> getCurrent() {
-		ReleasableContainer releasableContainer;
-		
-		releasableContainer = new ReleasableContainer();
-		try {
+		try (ReleasableContainer releasableContainer = new ReleasableContainer()) {
 			List<ReleasableIterator<EntityContainer>> sources;
 			MultipleSourceIterator<EntityContainer> resultIterator;
 			
@@ -155,9 +134,6 @@ public class AllEntityDao implements ReplicationSource {
 			releasableContainer.clear();
 			
 			return resultIterator;
-			
-		} finally {
-			releasableContainer.release();
 		}
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeReader.java
index 889989b..e902e30 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeReader.java
@@ -96,7 +96,7 @@ public class ChangeReader<T extends Entity> implements ReleasableIterator<Change
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeWriter.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeWriter.java
index 3f92677..92d09f7 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeWriter.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangeWriter.java
@@ -6,19 +6,19 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Timestamp;
 import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
-import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.apidb.common.DatabaseContext;
+import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.DatabaseLoginCredentials;
 import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
+import org.openstreetmap.osmosis.core.domain.v0_6.Entity;
 import org.openstreetmap.osmosis.core.domain.v0_6.Node;
 import org.openstreetmap.osmosis.core.domain.v0_6.Relation;
 import org.openstreetmap.osmosis.core.domain.v0_6.RelationMember;
 import org.openstreetmap.osmosis.core.domain.v0_6.Tag;
 import org.openstreetmap.osmosis.core.domain.v0_6.Way;
 import org.openstreetmap.osmosis.core.domain.v0_6.WayNode;
+import org.openstreetmap.osmosis.core.lifecycle.Completable;
 import org.openstreetmap.osmosis.core.task.common.ChangeAction;
 import org.openstreetmap.osmosis.core.util.FixedPrecisionCoordinateConvertor;
 import org.openstreetmap.osmosis.core.util.TileCalculator;
@@ -29,9 +29,7 @@ import org.openstreetmap.osmosis.core.util.TileCalculator;
  * 
  * @author Brett Henderson
  */
-public class ChangeWriter {
-
-    private static final Logger LOG = Logger.getLogger(ChangeWriter.class.getName());
+public class ChangeWriter implements Completable {
 
     private static final String INSERT_SQL_NODE =
     	"INSERT INTO nodes (node_id, version, timestamp, visible, changeset_id, latitude, longitude, tile)"
@@ -229,38 +227,12 @@ public class ChangeWriter {
      * @throws SQLException if an error occurs accessing the database.
      */
     private boolean checkIfEntityExists(PreparedStatement statement, long id) throws SQLException {
-        boolean exists;
-        ResultSet resultSet;
-
-        resultSet = null;
-        try {
-            statement.setLong(1, id);
-
-            resultSet = statement.executeQuery();
-
-            resultSet.next();
-
-            if (resultSet.getInt("rowCount") == 0) {
-                exists = false;
-            } else {
-                exists = true;
-            }
-
-            resultSet.close();
-            resultSet = null;
-
-            return exists;
-
-        } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close entity existence check result set.", e);
-                }
-            }
-        }
+    	statement.setLong(1, id);
+    	try (ResultSet resultSet = statement.executeQuery()) {
+    		resultSet.next();
+    		
+    		return (resultSet.getInt("rowCount") != 0);
+    	}
     }
 
     /**
@@ -273,40 +245,21 @@ public class ChangeWriter {
      * @throws SQLException if an error occurs accessing the database.
      */
     private boolean checkIfEntityHistoryExists(PreparedStatement statement, long id, int version) throws SQLException {
-        boolean exists;
-        ResultSet resultSet;
-        int prmIndex;
-
-        resultSet = null;
-        try {
-            prmIndex = 1;
-            statement.setLong(prmIndex++, id);
-            statement.setInt(prmIndex++, version);
-
-            resultSet = statement.executeQuery();
-
-            resultSet.next();
-
-            if (resultSet.getInt("rowCount") == 0) {
-                exists = false;
-            } else {
-                exists = true;
-            }
-
-            resultSet.close();
-            resultSet = null;
-
-            return exists;
+    	int prmIndex = 1;
+        statement.setLong(prmIndex++, id);
+        statement.setInt(prmIndex++, version);
+        
+        try (ResultSet resultSet = statement.executeQuery()) {
+    		resultSet.next();
+    		
+    		return (resultSet.getInt("rowCount") != 0);
+    	}
+    }
 
-        } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close entity history existence result set.", e);
-                }
-            }
+    private void assertEntityHasTimestamp(Entity entity) {
+        if (entity.getTimestamp() == null) {
+            throw new OsmosisRuntimeException(
+                    entity.getType().toString() + " " + entity.getId() + " does not have a timestamp set.");
         }
     }
 
@@ -321,10 +274,7 @@ public class ChangeWriter {
         boolean exists;
         int prmIndex;
 
-        // We can't write an entity with a null timestamp.
-        if (node.getTimestamp() == null) {
-            throw new OsmosisRuntimeException("Node " + node.getId() + " does not have a timestamp set.");
-        }
+        assertEntityHasTimestamp(node);
 
         // Add or update the user in the database.
         userManager.addOrUpdateUser(node.getUser());
@@ -526,10 +476,7 @@ public class ChangeWriter {
         int prmIndex;
         List<WayNode> nodeReferenceList;
 
-        // We can't write an entity with a null timestamp.
-        if (way.getTimestamp() == null) {
-            throw new OsmosisRuntimeException("Way " + way.getId() + " does not have a timestamp set.");
-        }
+        assertEntityHasTimestamp(way);
 
         // Add or update the user in the database.
         userManager.addOrUpdateUser(way.getUser());
@@ -774,10 +721,7 @@ public class ChangeWriter {
         int prmIndex;
         List<RelationMember> relationMemberList;
 
-        // We can't write an entity with a null timestamp.
-        if (relation.getTimestamp() == null) {
-            throw new OsmosisRuntimeException("Relation " + relation.getId() + " does not have a timestamp set.");
-        }
+        assertEntityHasTimestamp(relation);
 
         // Add or update the user in the database.
         userManager.addOrUpdateUser(relation.getUser());
@@ -1064,11 +1008,11 @@ public class ChangeWriter {
     /**
      * Releases all database resources.
      */
-    public void release() {
-        statementContainer.release();
-        userManager.release();
-        changesetManager.release();
+    public void close() {
+        statementContainer.close();
+        userManager.close();
+        changesetManager.close();
 
-        dbCtx.release();
+        dbCtx.close();
     }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManager.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManager.java
index bf2e275..9e86a9f 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManager.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManager.java
@@ -7,15 +7,13 @@ import java.sql.SQLException;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
+import org.openstreetmap.osmosis.apidb.common.DatabaseContext;
 import org.openstreetmap.osmosis.core.OsmosisConstants;
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.apidb.common.DatabaseContext;
 import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
 import org.openstreetmap.osmosis.core.domain.v0_6.OsmUser;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.lifecycle.ReleasableContainer;
 import org.openstreetmap.osmosis.core.util.FixedPrecisionCoordinateConvertor;
 
@@ -25,9 +23,7 @@ import org.openstreetmap.osmosis.core.util.FixedPrecisionCoordinateConvertor;
  * 
  * @author Brett Henderson
  */
-public class ChangesetManager implements Releasable {
-
-	private static final Logger LOG = Logger.getLogger(ChangesetManager.class.getName());
+public class ChangesetManager implements Closeable {
 	
 	private static final int MAX_CHANGESET_ID_CACHE_SIZE = 32768;
 
@@ -72,28 +68,11 @@ public class ChangesetManager implements Releasable {
     
     
     private int readChangesetCount(ResultSet countSet) {
-    	ResultSet resultSet = countSet;
-    	
-    	try {
-    		int changesetCount;
-    		
-    		resultSet.next();
-    		changesetCount = resultSet.getInt("changesetCount");
-    		resultSet.close();
-    		resultSet = null;
-    		
-    		return changesetCount;
-    		
+    	try (ResultSet resultSet = countSet) {
+            resultSet.next();
+    		return resultSet.getInt("changesetCount");
     	} catch (SQLException e) {
     		throw new OsmosisRuntimeException("Unable to read the changeset count.", e);
-    	} finally {
-    		if (resultSet != null) {
-    			try {
-    				resultSet.close();
-    			} catch (SQLException e) {
-    				LOG.log(Level.WARNING, "Unable to close result set.", e);
-    			}
-    		}
     	}
     }
     
@@ -181,7 +160,7 @@ public class ChangesetManager implements Releasable {
      * {@inheritDoc}
      */
     @Override
-    public void release() {
-        releasableContainer.release();
+    public void close() {
+        releasableContainer.close();
     }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/DeltaToDiffReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/DeltaToDiffReader.java
index 4b57b97..6e9b98b 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/DeltaToDiffReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/DeltaToDiffReader.java
@@ -101,7 +101,7 @@ public class DeltaToDiffReader implements ReleasableIterator<ChangeContainer> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sourceIterator.release();
+	public void close() {
+		sourceIterator.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityContainerReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityContainerReader.java
index 27dc84f..79d9962 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityContainerReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityContainerReader.java
@@ -86,7 +86,7 @@ public class EntityContainerReader<T extends Entity> implements ReleasableIterat
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityDao.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityDao.java
index a008d0e..3fd0c62 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityDao.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityDao.java
@@ -184,7 +184,7 @@ public abstract class EntityDao<T extends Entity> {
 			
 		} finally {
 			if (sortingStore != null) {
-				sortingStore.release();
+				sortingStore.close();
 			}
 		}
 	}
@@ -246,7 +246,7 @@ public abstract class EntityDao<T extends Entity> {
 			
 		} finally {
 			if (sortingStore != null) {
-				sortingStore.release();
+				sortingStore.close();
 			}
 		}
 	}
@@ -282,7 +282,7 @@ public abstract class EntityDao<T extends Entity> {
 			return entityHistoryReader;
 			
 		} finally {
-			releasableContainer.release();
+			releasableContainer.close();
 		}
 	}
 	
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryListReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryListReader.java
index 152e147..8b6b9be 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryListReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryListReader.java
@@ -89,7 +89,7 @@ public class EntityHistoryListReader implements ReleasableIterator<List<ChangeCo
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		sourceIterator.release();
+	public void close() {
+		sourceIterator.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryReader.java
index f63fb3f..8281271 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityHistoryReader.java
@@ -124,7 +124,7 @@ public class EntityHistoryReader<T extends Entity> implements ReleasableIterator
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		releasableContainer.release();
+	public void close() {
+		releasableContainer.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntitySnapshotReader.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntitySnapshotReader.java
index 62070f2..f2e8fef 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntitySnapshotReader.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntitySnapshotReader.java
@@ -103,7 +103,7 @@ public class EntitySnapshotReader implements ReleasableIterator<EntityContainer>
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sourceIterator.release();
+	public void close() {
+		sourceIterator.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/FeatureHistoryPopulator.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/FeatureHistoryPopulator.java
index 1f02511..2bf3732 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/FeatureHistoryPopulator.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/FeatureHistoryPopulator.java
@@ -62,7 +62,7 @@ public class FeatureHistoryPopulator<Te extends Entity, Tf extends Storeable, Td
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/RelationDao.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/RelationDao.java
index 927d43b..b2d3cfc 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/RelationDao.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/RelationDao.java
@@ -130,7 +130,7 @@ public class RelationDao extends EntityDao<Relation> {
 			
 		} finally {
 			if (sortingStore != null) {
-				sortingStore.release();
+				sortingStore.close();
 			}
 		}
 	}
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/Replicator.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/Replicator.java
index 9a4dc4c..f9fe7ff 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/Replicator.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/Replicator.java
@@ -207,18 +207,18 @@ public class Replicator {
 
 
 	private void copyChanges(ReleasableIterator<ChangeContainer> sourceIterator, ReplicationState state) {
-		try {
+		try (ReleasableIterator<ChangeContainer> i = sourceIterator) {
 			Date currentTimestamp;
 
 			// As we process, we must update the timestamp to match the latest
 			// record we have received.
 			currentTimestamp = state.getTimestamp();
 
-			while (sourceIterator.hasNext()) {
+			while (i.hasNext()) {
 				ChangeContainer change;
 				Date nextTimestamp;
 
-				change = sourceIterator.next();
+				change = i.next();
 				nextTimestamp = change.getEntityContainer().getEntity().getTimestamp();
 
 				if (currentTimestamp.compareTo(nextTimestamp) < 0) {
@@ -230,8 +230,6 @@ public class Replicator {
 
 			state.setTimestamp(currentTimestamp);
 
-		} finally {
-			sourceIterator.release();
 		}
 	}
 
@@ -244,7 +242,7 @@ public class Replicator {
 			replicateLoop();
 
 		} finally {
-			changeSink.release();
+			changeSink.close();
 		}
 	}
 
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/SchemaVersionValidator.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/SchemaVersionValidator.java
index 372d988..9ef47d1 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/SchemaVersionValidator.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/SchemaVersionValidator.java
@@ -9,8 +9,8 @@ import java.util.List;
 import java.util.Set;
 import java.util.logging.Logger;
 
-import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.apidb.common.DatabaseContext;
+import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.DatabaseLoginCredentials;
 import org.openstreetmap.osmosis.core.database.DatabasePreferences;
 
@@ -26,22 +26,20 @@ public class SchemaVersionValidator {
 
     private static final String SELECT_SQL = "SELECT version FROM schema_migrations";
 
+    private final DatabaseLoginCredentials credentials;
     private final DatabasePreferences preferences;
 
-    private final DatabaseContext dbCtx;
-
     private boolean validated;
 
     /**
      * Creates a new instance.
      * 
-     * @param loginCredentials Contains all information required to connect to the database.
+     * @param credentials Contains all information required to connect to the database.
      * @param preferences The database preferences.
      */
-    public SchemaVersionValidator(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences) {
+    public SchemaVersionValidator(DatabaseLoginCredentials credentials, DatabasePreferences preferences) {
+    	this.credentials = credentials;
         this.preferences = preferences;
-
-        dbCtx = new DatabaseContext(loginCredentials);
     }
 
     /**
@@ -65,8 +63,7 @@ public class SchemaVersionValidator {
      */
     private void validateDBVersion(String[] expectedMigrations) {
         if (preferences.getValidateSchemaVersion()) {
-            try {
-                ResultSet resultSet;
+            try (DatabaseContext dbCtx = new DatabaseContext(credentials)) {
                 Set<String> actualMigrationSet;
                 Set<String> expectedMigrationSet;
                 List<String> matchingMigrations;
@@ -79,11 +76,13 @@ public class SchemaVersionValidator {
 
                 // Load the database migrations into a Set.
                 actualMigrationSet = new HashSet<String>();
-                resultSet = dbCtx.executeQuery(SELECT_SQL);
-                while (resultSet.next()) {
-                    actualMigrationSet.add(resultSet.getString("version"));
+                try (ResultSet resultSet = dbCtx.executeQuery(SELECT_SQL)) {
+	                while (resultSet.next()) {
+	                    actualMigrationSet.add(resultSet.getString("version"));
+	                }
+                } catch (SQLException e) {
+                	throw new OsmosisRuntimeException("Unable to retrieve existing database migrations", e);
                 }
-                resultSet.close();
 
                 // Remove items from both sets that are identical.
                 matchingMigrations = new ArrayList<String>();
@@ -119,19 +118,7 @@ public class SchemaVersionValidator {
                         throw new OsmosisRuntimeException(errorMessage.toString());
                     }
                 }
-
-            } catch (SQLException e) {
-                throw new OsmosisRuntimeException("Unable to read the schema version from the schema info table.", e);
-            } finally {
-                cleanup();
             }
         }
     }
-
-    /**
-     * Releases all resources allocated during execution.
-     */
-    private void cleanup() {
-        dbCtx.release();
-    }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/UserManager.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/UserManager.java
index 74ad14d..e189834 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/UserManager.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/UserManager.java
@@ -6,23 +6,20 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
-import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.apidb.common.DatabaseContext;
+import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
 import org.openstreetmap.osmosis.core.domain.v0_6.OsmUser;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
+
 
 /**
  * Creates or loads the details of the Osmosis user in the database.
  * 
  * @author Brett Henderson
  */
-public class UserManager implements Releasable {
-
-    private static final Logger LOG = Logger.getLogger(UserManager.class.getName());
+public class UserManager implements Closeable {
 
     private static final String SELECT_SQL_USER_EXISTS = "SELECT Count(id) AS userCount FROM users WHERE id = ?";
 
@@ -64,46 +61,21 @@ public class UserManager implements Releasable {
      * @return True if the user exists, false otherwise.
      */
     private boolean doesUserExistInDb(OsmUser user) {
-        int prmIndex;
-        ResultSet resultSet;
-
         if (statementExists == null) {
             statementExists = statementContainer.add(dbCtx.prepareStatementForStreaming(SELECT_SQL_USER_EXISTS));
         }
 
-        resultSet = null;
         try {
-            boolean result;
-
-            prmIndex = 1;
-            statementExists.setInt(prmIndex++, user.getId());
-
-            resultSet = statementExists.executeQuery();
-            resultSet.next();
-
-            if (resultSet.getInt("userCount") == 0) {
-                result = false;
-            } else {
-                result = true;
-            }
-
-            resultSet.close();
-            resultSet = null;
-
-            return result;
-
+	        statementExists.setInt(1, user.getId());
+	        
+	        try (ResultSet resultSet = statementExists.executeQuery()) {
+	        	resultSet.next();
+	        	
+	        	return resultSet.getInt("userCount") != 0;
+	        }
         } catch (SQLException e) {
             throw new OsmosisRuntimeException("Unable to check if user with id " + user.getId()
                     + " exists in the database.", e);
-        } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close existing user result set.", e);
-                }
-            }
         }
     }
 
@@ -199,7 +171,7 @@ public class UserManager implements Releasable {
      * {@inheritDoc}
      */
     @Override
-    public void release() {
-        statementContainer.release();
+    public void close() {
+        statementContainer.close();
     }
 }
diff --git a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/WayDao.java b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/WayDao.java
index b42520d..eb6ec5a 100644
--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/WayDao.java
+++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/WayDao.java
@@ -130,7 +130,7 @@ public class WayDao extends EntityDao<Way> {
 			
 		} finally {
 			if (sortingStore != null) {
-				sortingStore.release();
+				sortingStore.close();
 			}
 		}
 	}
diff --git a/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManagerTest.java b/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManagerTest.java
index 9b35613..2a20f94 100644
--- a/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManagerTest.java
+++ b/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/ChangesetManagerTest.java
@@ -22,35 +22,32 @@ public class ChangesetManagerTest extends AbstractDataTest {
      */
     @Test
     public void testChangeset() {
-    	DatabaseContext dbCtx;
-    	UserManager userManager;
-    	ChangesetManager changesetManager;
     	OsmUser user;
     	long changesetId;
-    	
+
     	user = new OsmUser(1, "user");
     	changesetId = 2;
-    	
-    	dbCtx = dbUtils.createDatabaseContext();
-    	
-    	// Reset the database to a clean state.
-    	dbUtils.truncateDatabase();
-    	
-    	userManager = new UserManager(dbCtx);
-    	changesetManager = new ChangesetManager(dbCtx);
-    	
-    	userManager.addOrUpdateUser(user);
-    	
-    	// Create the changeset in the database.
-    	changesetManager.addChangesetIfRequired(changesetId, user);
-    	
-    	// Make the same call which should just return if the changeset is already known.
-    	changesetManager.addChangesetIfRequired(changesetId, user);
-    	
-    	// Create a new instance of the manager to verify that it copes with a non-cached changeset.
-    	changesetManager = new ChangesetManager(dbCtx);
-    	changesetManager.addChangesetIfRequired(changesetId, user);
-    	
-    	dbCtx.release();
+
+    	try (DatabaseContext dbCtx = dbUtils.createDatabaseContext()) {
+	    	// Reset the database to a clean state.
+	    	dbUtils.truncateDatabase();
+	    	
+	    	try (UserManager userManager = new UserManager(dbCtx)) {
+	    		userManager.addOrUpdateUser(user);
+	    	}
+
+	    	try (ChangesetManager changesetManager = new ChangesetManager(dbCtx)) {		    	
+		    	// Create the changeset in the database.
+		    	changesetManager.addChangesetIfRequired(changesetId, user);
+		    	
+		    	// Make the same call which should just return if the changeset is already known.
+		    	changesetManager.addChangesetIfRequired(changesetId, user);
+	    	}
+
+	    	// Create a new instance of the manager to verify that it copes with a non-cached changeset.
+	    	try (ChangesetManager changesetManager = new ChangesetManager(dbCtx)) {
+		    	changesetManager.addChangesetIfRequired(changesetId, user);
+	    	}
+    	}
     }
 }
diff --git a/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/MockReplicationDestination.java b/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/MockReplicationDestination.java
index 39aebc2..ea300ce 100644
--- a/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/MockReplicationDestination.java
+++ b/osmosis-apidb/src/test/java/org/openstreetmap/osmosis/apidb/v0_6/impl/MockReplicationDestination.java
@@ -86,7 +86,7 @@ public class MockReplicationDestination implements ChangeSink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 	
diff --git a/osmosis-apidb/src/test/resources/data/template/v0_6/apidb-authfile.txt b/osmosis-apidb/src/test/resources/data/template/v0_6/apidb-authfile.txt
index cfd0584..28ab556 100644
--- a/osmosis-apidb/src/test/resources/data/template/v0_6/apidb-authfile.txt
+++ b/osmosis-apidb/src/test/resources/data/template/v0_6/apidb-authfile.txt
@@ -1,4 +1,4 @@
-host=localhost
+host=db
 database=api06_test
 user=osm
 password=password
diff --git a/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/common/PolygonFileReader.java b/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/common/PolygonFileReader.java
index bc2a783..24d9285 100644
--- a/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/common/PolygonFileReader.java
+++ b/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/common/PolygonFileReader.java
@@ -7,11 +7,6 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 
@@ -58,21 +53,11 @@ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
  * @author Brett Henderson
  */
 public class PolygonFileReader {
-
-	/**
-	 * Our logger for debug and error -output.
-	 */
-    private static final Logger LOG = Logger.getLogger(PolygonFileReader.class.getName());
-
-	/**
-	 * Where we read from.
-	 */
-	private Reader fileReader;
-
-	/**
-	 * The filename for error-messages.
-	 */
-	private String polygonFile;
+    
+    /**
+     * The file containing polygon data.
+     */
+    private File polygonFile;
 
 	/**
 	 * The name of the polygon as stated in the file-header.
@@ -84,42 +69,9 @@ public class PolygonFileReader {
 	 * 
 	 * @param polygonFile
 	 *            The file to read polygon units from.
-	 * @param name to report in debug output
-	 */
-	public PolygonFileReader(final InputStream polygonFile, final String name) {
-		this.polygonFile = name;
-		this.fileReader = new InputStreamReader(polygonFile);
-	}
-
-	/**
-	 * Creates a new instance.
-	 * 
-	 * @param polygonFile
-	 *            The file to read polygon units from.
 	 */
 	public PolygonFileReader(final File polygonFile) {
-		try {
-			this.polygonFile = polygonFile.getName();
-			this.fileReader = new FileReader(polygonFile);
-		} catch (IOException e) {
-			throw new OsmosisRuntimeException("Unable to read from polygon file " + polygonFile + ".", e);
-		}
-	}
-	
-	
-	/**
-	 * Releases any resources remaining open.
-	 */
-	private void cleanup() {
-		if (fileReader != null) {
-			try {
-				fileReader.close();
-			} catch (Exception e) {
-				LOG.log(Level.SEVERE, "Unable to close polygon file reader.", e);
-			} finally {
-				fileReader = null;
-			}
-		}
+		this.polygonFile = polygonFile;
 	}
 	
 	
@@ -130,15 +82,11 @@ public class PolygonFileReader {
 	 * @return A fully configured area.
 	 */
 	public Area loadPolygon() {
-		try {
+		try (BufferedReader bufferedReader = new BufferedReader(new FileReader(polygonFile))) {
 			Area resultArea;
-			BufferedReader bufferedReader;
 			// Create a new area.
 			resultArea = new Area();
 
-            // Open the polygon file.
-            bufferedReader = new BufferedReader(fileReader);
-
             // Read the file header.
             myPolygonName = bufferedReader.readLine();
             if (myPolygonName == null || myPolygonName.trim().length() == 0) {
@@ -191,8 +139,6 @@ public class PolygonFileReader {
 			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read from polygon file " + polygonFile + ".", e);
-		} finally {
-			cleanup();
 		}
 	}
 	
diff --git a/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilter.java b/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilter.java
index 088e3c3..2f4f068 100644
--- a/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilter.java
+++ b/osmosis-areafilter/src/main/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilter.java
@@ -374,9 +374,7 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 	
 	
 	private boolean selectParentRelationsPass() {
-		ReleasableIterator<RelationContainer> i = allRelations.iterate();
-		
-		try {
+		try (ReleasableIterator<RelationContainer> i = allRelations.iterate()) {
 			int selectionCount;
 			
 			selectionCount = 0;
@@ -403,8 +401,6 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 			
 			return selectionCount > 0;
 			
-		} finally {
-			i.release();
 		}
 	}
 
@@ -430,9 +426,7 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 	 * @return True if additional selections were made an another pass is needed.
 	 */
 	private boolean selectChildRelationsPass() {
-		ReleasableIterator<RelationContainer> i = allRelations.iterate();
-		
-		try {
+		try (ReleasableIterator<RelationContainer> i = allRelations.iterate()) {
 			int selectionCount;
 			
 			selectionCount = 0;
@@ -458,9 +452,6 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 			}
 			
 			return selectionCount > 0;
-			
-		} finally {
-			i.release();
 		}
 	}
 	
@@ -469,9 +460,7 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 	 * Select all relation members of type node or way for existing selected relations.
 	 */
 	private void selectChildNonRelationsPass() {
-		ReleasableIterator<RelationContainer> i = allRelations.iterate();
-		
-		try {
+		try (ReleasableIterator<RelationContainer> i = allRelations.iterate()) {
 			while (i.hasNext()) {
 				Relation relation = i.next().getEntity();
 				long relationId = relation.getId();
@@ -493,9 +482,6 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 					}
 				}
 			}
-			
-		} finally {
-			i.release();
 		}
 	}
 	
@@ -504,9 +490,7 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 	 * Select all nodes within already selected ways.
 	 */
 	private void selectWayNodes() {
-		ReleasableIterator<WayContainer> i = allWays.iterate();
-		
-		try {
+		try (ReleasableIterator<WayContainer> i = allWays.iterate()) {
 			while (i.hasNext()) {
 				Way way = i.next().getEntity();
 				long wayId = way.getId();
@@ -519,9 +503,6 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 					}
 				}
 			}
-			
-		} finally {
-			i.release();
 		}
 	}
 	
@@ -543,52 +524,37 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
     
     
     private void pumpNodesToSink() {
-    	ReleasableIterator<NodeContainer> i = allNodes.iterate();
-    	
-    	try {
+    	try (ReleasableIterator<NodeContainer> i = allNodes.iterate()) {
     		while (i.hasNext()) {
 				NodeContainer nodeContainer = i.next();
 				if (availableNodes.get(nodeContainer.getEntity().getId())) {
 					emitNode(nodeContainer);
 				}
 			}
-    		
-    	} finally {
-    		i.release();
     	}
     }
     
     
     private void pumpWaysToSink() {
-    	ReleasableIterator<WayContainer> i = allWays.iterate();
-    	
-    	try {
+    	try (ReleasableIterator<WayContainer> i = allWays.iterate()) {
     		while (i.hasNext()) {
 				WayContainer wayContainer = i.next();
 				if (availableWays.get(wayContainer.getEntity().getId())) {
 					emitWay(wayContainer);
 				}
 			}
-    		
-    	} finally {
-    		i.release();
     	}
     }
     
     
     private void pumpRelationsToSink() {
-    	ReleasableIterator<RelationContainer> i = allRelations.iterate();
-    	
-    	try {
+    	try (ReleasableIterator<RelationContainer> i = allRelations.iterate()) {
     		while (i.hasNext()) {
 				RelationContainer relationContainer = i.next();
 				if (availableRelations.get(relationContainer.getEntity().getId())) {
 					emitRelation(relationContainer);
 				}
 			}
-    		
-    	} finally {
-    		i.release();
     	}
     }
 	
@@ -636,17 +602,17 @@ public abstract class AreaFilter implements SinkSource, EntityProcessor {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (allNodes != null) {
-			allNodes.release();
+			allNodes.close();
 		}
 		if (allWays != null) {
-			allWays.release();			
+			allWays.close();			
 		}
 		if (allRelations != null) {
-			allRelations.release();
+			allRelations.close();
 		}
-		sink.release();
+		sink.close();
 	}
 	
 	
diff --git a/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilterTest.java b/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilterTest.java
index fdfd4e7..a787a99 100644
--- a/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilterTest.java
+++ b/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/AreaFilterTest.java
@@ -33,7 +33,7 @@ public class AreaFilterTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -68,7 +68,7 @@ public class AreaFilterTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -102,7 +102,7 @@ public class AreaFilterTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -137,7 +137,7 @@ public class AreaFilterTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -172,7 +172,7 @@ public class AreaFilterTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -207,7 +207,7 @@ public class AreaFilterTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
diff --git a/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/BoundingBoxFilterTest.java b/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/BoundingBoxFilterTest.java
index 026d299..60287f4 100644
--- a/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/BoundingBoxFilterTest.java
+++ b/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/BoundingBoxFilterTest.java
@@ -82,7 +82,7 @@ public class BoundingBoxFilterTest {
 	 */
 	@After
 	public void tearDown() {
-		simpleAreaFilter.release();
+		simpleAreaFilter.close();
 	}
 
 
diff --git a/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/PolygonFilterTest.java b/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/PolygonFilterTest.java
index e411cf2..e824c28 100644
--- a/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/PolygonFilterTest.java
+++ b/osmosis-areafilter/src/test/java/org/openstreetmap/osmosis/areafilter/v0_6/PolygonFilterTest.java
@@ -73,7 +73,7 @@ public class PolygonFilterTest {
 	 */
 	@After
 	public void tearDown() {
-		polyAreaFilter.release();
+		polyAreaFilter.close();
 	}
 
 
diff --git a/osmosis-core/build.gradle b/osmosis-core/build.gradle
index abdb0c4..c9f7806 100644
--- a/osmosis-core/build.gradle
+++ b/osmosis-core/build.gradle
@@ -1,6 +1,4 @@
 configurations {
-    // Exclude because all necessary APIs are included in the JDK.
-    all*.exclude group: 'xml-apis', module: 'xml-apis'
     // Exclude because Stax is included in the JDK from java 1.6 onwards.
     all*.exclude group: 'javax.xml.stream', module: 'stax-api'
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/LogLevels.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/LogLevels.java
index 7931e87..5028fde 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/LogLevels.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/LogLevels.java
@@ -12,13 +12,6 @@ import java.util.logging.Level;
 public final class LogLevels {
 
 	/**
-	 * This class cannot be instantiated.
-	 */
-	private LogLevels() {
-		// Not callable.
-	}
-
-	/**
 	 * This is the default offset into the LOG_LEVELS array.
 	 */
 	public static final int DEFAULT_LEVEL_INDEX = 3;
@@ -26,16 +19,23 @@ public final class LogLevels {
 	/**
 	 * Defines the log levels supported from the command line.
 	 */
-	public static final Level [] LOG_LEVELS = {
-		Level.OFF,
-		Level.SEVERE,
-		Level.WARNING,
-		Level.INFO,
-		Level.FINE,
-		Level.FINER,
-		Level.FINEST
+	public static final Level[] LOG_LEVELS = {
+			Level.OFF,
+			Level.SEVERE,
+			Level.WARNING,
+			Level.INFO,
+			Level.FINE,
+			Level.FINER,
+			Level.FINEST
 	};
 
+	/**
+	 * This class cannot be instantiated.
+	 */
+	private LogLevels() {
+		// Not callable.
+	}
+
 
 	/**
 	 * Map a log level index to a log level. This will clip log levels to
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/TaskRegistrar.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/TaskRegistrar.java
index 6875569..71db037 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/TaskRegistrar.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/TaskRegistrar.java
@@ -95,17 +95,15 @@ public class TaskRegistrar {
 		try {
 			for (URL pluginConfigurationUrl : Collections.list(Thread.currentThread()
 					.getContextClassLoader().getResources(pluginResourceName))) {
-				InputStream pluginInputStream;
 				BufferedReader pluginReader;
 				
 				LOG.finer("Loading plugin configuration file from url " + pluginConfigurationUrl + ".");
 				
-				pluginInputStream = pluginConfigurationUrl.openStream();
-				if (pluginInputStream == null) {
-					throw new OsmosisRuntimeException("Cannot open URL " + pluginConfigurationUrl + ".");
-				}
-				
-				try {
+				try (InputStream pluginInputStream = pluginConfigurationUrl.openStream()) {
+					if (pluginInputStream == null) {
+						throw new OsmosisRuntimeException("Cannot open URL " + pluginConfigurationUrl + ".");
+					}
+					
 					pluginReader = new BufferedReader(new InputStreamReader(pluginInputStream));
 					
 					for (;;) {
@@ -123,12 +121,6 @@ public class TaskRegistrar {
 							loadPlugin(plugin);
 						}
 					}
-				} finally {
-					try {
-						pluginInputStream.close();
-					} catch (IOException e) {
-						LOG.warning("Unable to close plugin resource " + pluginResourceName + ".");
-					}
 				}
 			}
 			
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputer.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputer.java
index 87be047..2c875fc 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputer.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputer.java
@@ -82,17 +82,9 @@ public class BoundComputer implements SinkSource, EntityProcessor {
 			sink.process(new BoundContainer(new Bound(right, left, top, bottom, this.origin)));
 		}
 
-		ReleasableIterator<EntityContainer> iter = null;
-
-		try {
-			iter = objects.iterate();
-
-			while (iter.hasNext()) {
-				sink.process(iter.next());
-			}
-		} finally {
-			if (iter != null) {
-				iter.release();
+		try (ReleasableIterator<EntityContainer> i = objects.iterate()) {
+			while (i.hasNext()) {
+				sink.process(i.next());
 			}
 		}
 
@@ -101,9 +93,9 @@ public class BoundComputer implements SinkSource, EntityProcessor {
 
 
 	@Override
-	public void release() {
-		sink.release();
-		objects.release();
+	public void close() {
+		sink.close();
+		objects.close();
 	}
 
 
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetter.java
index 07b139c..9478fd6 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetter.java
@@ -78,8 +78,8 @@ public class BoundSetter implements SinkSource {
 
 
 	@Override
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 
 
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/ChangeBuffer.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/ChangeBuffer.java
index f2ace03..575f2ef 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/ChangeBuffer.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/ChangeBuffer.java
@@ -60,8 +60,8 @@ public class ChangeBuffer implements ChangeSinkRunnableChangeSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		buffer.release();
+	public void close() {
+		buffer.close();
 	}
 	
 	
@@ -88,7 +88,7 @@ public class ChangeBuffer implements ChangeSinkRunnableChangeSource {
 			buffer.outputComplete();
 			
 		} finally {
-			changeSink.release();
+			changeSink.close();
 			buffer.outputRelease();
 		}
 	}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/EntityBuffer.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/EntityBuffer.java
index 28db095..16b1be5 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/EntityBuffer.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/buffer/v0_6/EntityBuffer.java
@@ -60,8 +60,8 @@ public class EntityBuffer implements SinkRunnableSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		buffer.release();
+	public void close() {
+		buffer.close();
 	}
 	
 	
@@ -88,7 +88,7 @@ public class EntityBuffer implements SinkRunnableSource {
 			buffer.outputComplete();
 			
 		} finally {
-			sink.release();
+			sink.close();
 			buffer.outputRelease();
 		}
 	}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/cli/CommandLineParser.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/cli/CommandLineParser.java
index 81f6db9..251221f 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/cli/CommandLineParser.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/cli/CommandLineParser.java
@@ -59,7 +59,7 @@ public class CommandLineParser {
 	 * @param programArgs
 	 *            The arguments.
 	 */
-	public void parse(String [] programArgs) {
+	public void parse(String[] programArgs) {
 		List<GlobalOptionConfiguration> globalOptions;
 		
 		// Create the global options list.
@@ -202,7 +202,7 @@ public class CommandLineParser {
 	 *            The current offset through the command line arguments.
 	 * @return The new offset through the command line arguments.
 	 */
-	private int parseGlobalOption(List<GlobalOptionConfiguration> globalOptions, String [] programArgs, int offset) {
+	private int parseGlobalOption(List<GlobalOptionConfiguration> globalOptions, String[] programArgs, int offset) {
 		int i;
 		String argument;
 		GlobalOptionConfiguration globalOption;
@@ -235,7 +235,7 @@ public class CommandLineParser {
 	 *            The current offset through the command line arguments.
 	 * @return The new offset through the command line arguments.
 	 */
-	private int parseTask(String [] programArgs, int offset) {
+	private int parseTask(String[] programArgs, int offset) {
 		int i;
 		String taskType;
 		Map<String, String> taskArgs;
@@ -377,7 +377,7 @@ public class CommandLineParser {
 		/**
 		 * Creates a new instance.
 		 */
-		public GlobalOptionConfiguration() {
+		GlobalOptionConfiguration() {
 			parameters = new ArrayList<String>();
 		}
 	}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/BoundContainerIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/BoundContainerIterator.java
index 6f2350c..ef1ccb7 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/BoundContainerIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/BoundContainerIterator.java
@@ -53,7 +53,7 @@ public class BoundContainerIterator implements ReleasableIterator<BoundContainer
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/NodeContainerIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/NodeContainerIterator.java
index a014bc1..0300124 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/NodeContainerIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/NodeContainerIterator.java
@@ -53,7 +53,7 @@ public class NodeContainerIterator implements ReleasableIterator<NodeContainer>
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/RelationContainerIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/RelationContainerIterator.java
index c3c4c52..cedb4e1 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/RelationContainerIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/RelationContainerIterator.java
@@ -53,7 +53,7 @@ public class RelationContainerIterator implements ReleasableIterator<RelationCon
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/WayContainerIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/WayContainerIterator.java
index 88bb583..5dfd94c 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/WayContainerIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/container/v0_6/WayContainerIterator.java
@@ -53,7 +53,7 @@ public class WayContainerIterator implements ReleasableIterator<WayContainer> {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/AuthenticationPropertiesLoader.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/AuthenticationPropertiesLoader.java
index 3c342ca..00d1ebc 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/AuthenticationPropertiesLoader.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/AuthenticationPropertiesLoader.java
@@ -5,8 +5,6 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 
@@ -26,20 +24,13 @@ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
  */
 public class AuthenticationPropertiesLoader {
 
-    private static final Logger LOG = Logger.getLogger(AuthenticationPropertiesLoader.class.getName());
-
     private static final String KEY_HOST = "host";
-
     private static final String KEY_DATABASE = "database";
-
     private static final String KEY_USER = "user";
-
     private static final String KEY_PASSWORD = "password";
-
     private static final String KEY_DBTYPE = "dbType";
 
     private final File propertiesFile;
-
     private Properties properties;
 
     /**
@@ -53,26 +44,12 @@ public class AuthenticationPropertiesLoader {
     }
 
     private Properties loadProperties(File configFile) {
-        Properties loadedProperties;
-        FileInputStream fileInputStream = null;
-
-        loadedProperties = new Properties();
-
-        try {
-            fileInputStream = new FileInputStream(configFile);
+        Properties loadedProperties = new Properties();
 
+        try (FileInputStream fileInputStream = new FileInputStream(configFile)) {
             loadedProperties.load(fileInputStream);
-
         } catch (IOException e) {
             throw new OsmosisRuntimeException("Unable to load properties from config file " + configFile + ".", e);
-        } finally {
-            if (fileInputStream != null) {
-                try {
-                    fileInputStream.close();
-                } catch (IOException e) {
-                    LOG.log(Level.WARNING, "Unable to close input stream for properties file " + configFile + ".", e);
-                }
-            }
         }
 
         return loadedProperties;
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/DatabaseConstants.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/DatabaseConstants.java
index a906659..1ba3cab 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/DatabaseConstants.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/DatabaseConstants.java
@@ -8,13 +8,6 @@ package org.openstreetmap.osmosis.core.database;
  * @author Brett Henderson
  */
 public final class DatabaseConstants {
-	
-	/**
-	 * This class cannot be instantiated.
-	 */
-	private DatabaseConstants() {
-	}
-	
 
     /**
      * The task argument for specifying an database authorisation properties file.
@@ -35,7 +28,7 @@ public final class DatabaseConstants {
      * The task argument for specifying the user for a database connection.
      */
     public static final String TASK_ARG_USER = "user";
-    
+
     /**
      * The task argument for specifying the database type to be used.
      */
@@ -121,4 +114,10 @@ public final class DatabaseConstants {
      * The default value for specifying a postgresql schema.
      */
     public static final String TASK_DEFAULT_POSTGRES_SCHEMA = "";
+
+    /**
+     * This class cannot be instantiated.
+     */
+    private DatabaseConstants() {
+    }
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/FeaturePopulator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/FeaturePopulator.java
index cbc40a8..45d826a 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/FeaturePopulator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/FeaturePopulator.java
@@ -1,7 +1,7 @@
 // This software is released into the Public Domain.  See copying.txt for details.
 package org.openstreetmap.osmosis.core.database;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -10,7 +10,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * @param <T>
  *            The type of entity to be populated.
  */
-public interface FeaturePopulator<T> extends Releasable {
+public interface FeaturePopulator<T> extends Closeable {
 
 	/**
 	 * Populates the specified entity.
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/ReleasableStatementContainer.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/ReleasableStatementContainer.java
index 0c80765..a6b5d8f 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/ReleasableStatementContainer.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/database/ReleasableStatementContainer.java
@@ -8,7 +8,7 @@ import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -18,7 +18,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public class ReleasableStatementContainer implements Releasable {
+public class ReleasableStatementContainer implements Closeable {
 	private static final Logger LOG = Logger.getLogger(ReleasableStatementContainer.class.getName());
 	
 	private List<Statement> objects;
@@ -61,7 +61,7 @@ public class ReleasableStatementContainer implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		for (Statement statement : objects) {
 			try {
 				statement.close();
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/BitSetIdTracker.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/BitSetIdTracker.java
index 7bebe94..6c2184f 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/BitSetIdTracker.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/BitSetIdTracker.java
@@ -118,7 +118,7 @@ public class BitSetIdTracker implements IdTracker {
 		/**
 		 * Creates a new instance.
 		 */
-		public IdIterator() {
+		IdIterator() {
 			readingPositive = false;
 			nextIdAvailable = false;
 			
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/DynamicIdTracker.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/DynamicIdTracker.java
index 3461da7..32dd017 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/DynamicIdTracker.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/DynamicIdTracker.java
@@ -202,7 +202,7 @@ public class DynamicIdTracker implements IdTracker {
 		 * @param segments
 		 *            The segments to iterate over.
 		 */
-		public SegmentIdIterator(Iterator<DynamicIdTrackerSegment> segments) {
+		SegmentIdIterator(Iterator<DynamicIdTrackerSegment> segments) {
 			this.segments = segments;
 		}
 
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/ListIdTracker.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/ListIdTracker.java
index b080274..992790a 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/ListIdTracker.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/filter/common/ListIdTracker.java
@@ -240,7 +240,7 @@ public class ListIdTracker implements IdTracker {
 		/**
 		 * Creates a new instance.
 		 */
-		public IdIterator() {
+		IdIterator() {
 			iteratorOffset = 0;
 		}
 		
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Closeable.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Closeable.java
new file mode 100644
index 0000000..2be8183
--- /dev/null
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Closeable.java
@@ -0,0 +1,24 @@
+// This software is released into the Public Domain.  See copying.txt for details.
+package org.openstreetmap.osmosis.core.lifecycle;
+
+/**
+ * Classes that hold heavyweight resources that can't wait for garbage
+ * collection should implement this interface. It provides a {@link #close()}
+ * method that should be called by all clients when the class is no longer
+ * required. This release method is guaranteed not to throw exceptions and
+ * should always be called within a finally, or try-with-resources clause.
+ * 
+ * @author Brett Henderson
+ */
+public interface Closeable extends AutoCloseable {
+	/**
+	 * Performs resource cleanup tasks such as closing files, or database
+	 * connections. This must be called after all processing is complete.
+	 * Implementations should support being called multiple times, however this
+	 * is not mandatory and cannot be relied on by clients. Implementations must
+	 * call close on any nested {@link Closeable} objects. It does not throw
+	 * exceptions and should be called within a finally, or try-with-resources
+	 * clause to ensure it is called in exception scenarios.
+	 */
+	void close();
+}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Completable.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Completable.java
index e8a5926..ecaa482 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Completable.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Completable.java
@@ -9,7 +9,7 @@ package org.openstreetmap.osmosis.core.lifecycle;
  * 
  * @author Brett Henderson
  */
-public interface Completable extends Releasable {
+public interface Completable extends Closeable {
 
 	/**
 	 * Ensures that all information is fully persisted. This includes database
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/CompletableContainer.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/CompletableContainer.java
index b6e4173..8d142d6 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/CompletableContainer.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/CompletableContainer.java
@@ -56,9 +56,9 @@ public class CompletableContainer implements Completable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		for (Releasable object : objects) {
-			object.release();
+	public void close() {
+		for (Closeable object : objects) {
+			object.close();
 		}
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Releasable.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Releasable.java
deleted file mode 100644
index eb9284a..0000000
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/Releasable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// This software is released into the Public Domain.  See copying.txt for details.
-package org.openstreetmap.osmosis.core.lifecycle;
-
-
-/**
- * Classes that hold heavyweight resources that can't wait for garbage
- * collection should implement this interface. It provides a release method that
- * should be called by all clients when the class is no longer required. This
- * release method is guaranteed not to throw exceptions and should always be
- * called within a finally clause.
- * 
- * @author Brett Henderson
- */
-public interface Releasable {
-	/**
-	 * Performs resource cleanup tasks such as closing files, or database
-	 * connections. This must be called after all processing is complete.
-	 * Implementations should support calling release multiple times, however
-	 * this is not mandatory and cannot be relied on by clients. Implementations
-	 * must call release on any nested Releasable objects. It does not throw
-	 * exceptions and should be called within a finally block to ensure it is
-	 * called in exception scenarios.
-	 */
-	void release();
-}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableContainer.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableContainer.java
index 80db166..48e86e0 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableContainer.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableContainer.java
@@ -15,15 +15,15 @@ import java.util.List;
  * 
  * @author Brett Henderson
  */
-public class ReleasableContainer implements Releasable {
-	private List<Releasable> objects;
+public class ReleasableContainer implements Closeable {
+	private List<Closeable> objects;
 	
 	
 	/**
 	 * Creates a new instance.
 	 */
 	public ReleasableContainer() {
-		objects = new ArrayList<Releasable>();
+		objects = new ArrayList<Closeable>();
 	}
 	
 	
@@ -37,7 +37,7 @@ public class ReleasableContainer implements Releasable {
 	 *            The object to be stored.
 	 * @return The object that was stored.
 	 */
-	public <T extends Releasable> T add(T object) {
+	public <T extends Closeable> T add(T object) {
 		objects.add(object);
 		
 		return object;
@@ -56,9 +56,9 @@ public class ReleasableContainer implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		for (Releasable object : objects) {
-			object.release();
+	public void close() {
+		for (Closeable object : objects) {
+			object.close();
 		}
 		objects.clear();
 	}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableIterator.java
index fbf0c62..82b5b8a 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/lifecycle/ReleasableIterator.java
@@ -12,6 +12,6 @@ import java.util.Iterator;
  *            The data type to be iterated.
  * @author Brett Henderson
  */
-public interface ReleasableIterator<T> extends Iterator<T>, Releasable {
+public interface ReleasableIterator<T> extends Iterator<T>, Closeable {
 	// This combines multiple interfaces but doesn't add methods.
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyChangeReader.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyChangeReader.java
index bb76386..817b18e 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyChangeReader.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyChangeReader.java
@@ -34,7 +34,7 @@ public class EmptyChangeReader implements RunnableChangeSource {
 			changeSink.initialize(Collections.<String, Object>emptyMap());
 			changeSink.complete();
 		} finally {
-			changeSink.release();
+			changeSink.close();
 		}
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyReader.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyReader.java
index b8b1ebd..8b3e11c 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyReader.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/EmptyReader.java
@@ -34,7 +34,7 @@ public class EmptyReader implements RunnableSource {
 			sink.initialize(Collections.<String, Object>emptyMap());
 			sink.complete();
 		} finally {
-			sink.release();
+			sink.close();
 		}
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullChangeWriter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullChangeWriter.java
index 17ba5f2..4ec005b 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullChangeWriter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullChangeWriter.java
@@ -43,7 +43,7 @@ public class NullChangeWriter implements ChangeSink {
 	/**
 	 * Cleans up any open file handles.
 	 */
-	public void release() {
+	public void close() {
 		// Nothing to do.
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullWriter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullWriter.java
index c75505e..db1dc33 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullWriter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/misc/v0_6/NullWriter.java
@@ -43,7 +43,7 @@ public class NullWriter implements Sink {
 	/**
 	 * Cleans up any open file handles.
 	 */
-	public void release() {
+	public void close() {
 		// Nothing to do.
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/ChangeProgressLogger.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/ChangeProgressLogger.java
index 178779f..70c9b66 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/ChangeProgressLogger.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/ChangeProgressLogger.java
@@ -94,8 +94,8 @@ public class ChangeProgressLogger implements ChangeSinkChangeSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		changeSink.release();
+	public void close() {
+		changeSink.close();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/EntityProgressLogger.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/EntityProgressLogger.java
index b531e14..98fbf2e 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/EntityProgressLogger.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/progress/v0_6/EntityProgressLogger.java
@@ -90,8 +90,8 @@ public class EntityProgressLogger implements SinkSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/EntityReporter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/EntityReporter.java
index a764dd4..a80f346 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/EntityReporter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/EntityReporter.java
@@ -11,8 +11,6 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.container.v0_6.BoundContainer;
@@ -37,10 +35,7 @@ public class EntityReporter implements Sink {
 	private static final int COLUMN_WIDTH_WAY_COUNT = 7;
 	private static final int COLUMN_WIDTH_RELATION_COUNT = 7;
 	
-	private Logger log = Logger.getLogger(EntityReporter.class.getName());
-	
 	private File file;
-	private FileWriter fileWriter;
 	private Map<String, UserStatistics> userMap;
 	private UserStatistics anonymousUser;
 	private UserStatistics totalUser;
@@ -201,18 +196,10 @@ public class EntityReporter implements Sink {
 	 * Flushes all changes to file.
 	 */
 	public void complete() {
-		try {
-			BufferedWriter writer;
-			
-			fileWriter = new FileWriter(file);
-			writer = new BufferedWriter(fileWriter);
-			
+		try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
 			// Produce a report on the user statistics.
 			writeUserReport(writer);
-			
-			writer.close();
-			fileWriter = null;
-			
+
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to write report to file " + file + ".");
 		}
@@ -220,18 +207,9 @@ public class EntityReporter implements Sink {
 	
 	
 	/**
-	 * Cleans up any open file handles.
+	 * {@inheritDoc}
 	 */
-	public void release() {
-		if (fileWriter != null) {
-			try {
-				fileWriter.close();
-			} catch (IOException e) {
-				log.log(Level.SEVERE, "Unable to close file writer for file " + file + ".", e);
-			} finally {
-				fileWriter = null;
-			}
-		}
+	public void close() {
 	}
 	
 	
@@ -253,7 +231,7 @@ public class EntityReporter implements Sink {
 		 *            The name of the user that this statistics record relates
 		 *            to.
 		 */
-		public UserStatistics(String userName) {
+		UserStatistics(String userName) {
 			this.userName = userName;
 		}
 		
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/IntegrityReporter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/IntegrityReporter.java
index d83a3b9..0a4308b 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/IntegrityReporter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/report/v0_6/IntegrityReporter.java
@@ -233,7 +233,7 @@ public class IntegrityReporter implements Sink, EntityProcessor {
 	/**
 	 * Cleans up any open file handles.
 	 */
-	public void release() {
+	public void close() {
 		try {
 			try {
 				if (writer != null) {
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSort.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSort.java
index 0a40e0a..decf2f7 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSort.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSort.java
@@ -6,7 +6,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.lifecycle.ReleasableIterator;
 import org.openstreetmap.osmosis.core.store.ChunkedObjectStore;
 import org.openstreetmap.osmosis.core.store.ObjectSerializationFactory;
@@ -22,7 +22,7 @@ import org.openstreetmap.osmosis.core.store.Storeable;
  *            The object type to be sorted.
  * @author Brett Henderson
  */
-public class FileBasedSort<T extends Storeable> implements Releasable {
+public class FileBasedSort<T extends Storeable> implements Closeable {
 	/**
 	 * The maximum number of entities to perform memory-based sorting on,
 	 * amounts larger than this will be split into chunks of this size, the
@@ -166,7 +166,7 @@ public class FileBasedSort<T extends Storeable> implements Releasable {
 			// This will release the persistent iterator and its underlying
 			// source iterator if the persistence operations failed.
 			if (persistentIterator != null) {
-				persistentIterator.release();
+				persistentIterator.close();
 			}
 		}
 	}
@@ -264,7 +264,7 @@ public class FileBasedSort<T extends Storeable> implements Releasable {
 			
 		} finally {
 			for (ReleasableIterator<T> source : sources) {
-				source.release();
+				source.close();
 			}
 		}
 	}
@@ -285,7 +285,7 @@ public class FileBasedSort<T extends Storeable> implements Releasable {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		chunkedEntityStore.release();
+	public void close() {
+		chunkedEntityStore.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/MergingIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/MergingIterator.java
index 747b8cb..a7ea872 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/MergingIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/common/MergingIterator.java
@@ -53,7 +53,7 @@ public class MergingIterator<DataType> implements ReleasableIterator<DataType> {
 					sourceData.add(source.next());
 					sourceIndex++;
 				} else {
-					sources.remove(sourceIndex).release();
+					sources.remove(sourceIndex).close();
 				}
 			}
 		}
@@ -104,7 +104,7 @@ public class MergingIterator<DataType> implements ReleasableIterator<DataType> {
 		if (source.hasNext()) {
 			sourceData.set(indexMinimum, source.next());
 		} else {
-			sources.remove(indexMinimum).release();
+			sources.remove(indexMinimum).close();
 			sourceData.remove(indexMinimum);
 		}
 		
@@ -123,9 +123,9 @@ public class MergingIterator<DataType> implements ReleasableIterator<DataType> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		for (ReleasableIterator<DataType> source : sources) {
-			source.release();
+			source.close();
 		}
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeSorter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeSorter.java
index 3e4c8a5..294448e 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeSorter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeSorter.java
@@ -64,20 +64,12 @@ public class ChangeSorter implements ChangeSinkChangeSource {
 	 * {@inheritDoc}
 	 */
 	public void complete() {
-		ReleasableIterator<ChangeContainer> iterator = null;
-		
-		try {
-			iterator = fileBasedSort.iterate();
-			
+		try (ReleasableIterator<ChangeContainer> iterator = fileBasedSort.iterate()) {
 			while (iterator.hasNext()) {
 				changeSink.process(iterator.next());
 			}
 			
 			changeSink.complete();
-		} finally {
-			if (iterator != null) {
-				iterator.release();
-			}
 		}
 	}
 	
@@ -85,8 +77,8 @@ public class ChangeSorter implements ChangeSinkChangeSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		fileBasedSort.release();
-		changeSink.release();
+	public void close() {
+		fileBasedSort.close();
+		changeSink.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeTagSorter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeTagSorter.java
index 5006ed3..838f434 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeTagSorter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/ChangeTagSorter.java
@@ -90,7 +90,7 @@ public class ChangeTagSorter implements ChangeSinkChangeSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		changeSink.release();
+	public void close() {
+		changeSink.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/EntitySorter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/EntitySorter.java
index f56f794..f213924 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/EntitySorter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/EntitySorter.java
@@ -15,22 +15,35 @@ import org.openstreetmap.osmosis.core.task.v0_6.SinkSource;
 /**
  * A data stream filter that sorts entities. The sort order is specified by
  * comparator provided during instantiation.
- * 
+ *
  * @author Brett Henderson
  */
 public class EntitySorter implements SinkSource {
 	private FileBasedSort<EntityContainer> fileBasedSort;
 	private Sink sink;
-	
-	
+
+
 	/**
 	 * Creates a new instance.
-	 * 
+	 *
 	 * @param comparator
 	 *            The comparator to use for sorting.
 	 */
 	public EntitySorter(Comparator<EntityContainer> comparator) {
-		fileBasedSort = new FileBasedSort<EntityContainer>(new GenericObjectSerializationFactory(), comparator, true);
+		this(comparator, true);
+	}
+
+	/**
+	 * Creates a new instance.
+	 *
+	 * @param comparator
+	 *            The comparator to use for sorting.
+	 * @param useCompression
+	 *            If true, the storage files will be compressed.
+	 */
+	public EntitySorter(Comparator<EntityContainer> comparator, boolean useCompression) {
+		fileBasedSort = new FileBasedSort<EntityContainer>(
+			new GenericObjectSerializationFactory(), comparator, useCompression);
 	}
 
 
@@ -40,51 +53,43 @@ public class EntitySorter implements SinkSource {
 	public void initialize(Map<String, Object> metaData) {
 		sink.initialize(metaData);
 	}
-	
-	
+
+
 	/**
 	 * {@inheritDoc}
 	 */
 	public void process(EntityContainer entityContainer) {
 		fileBasedSort.add(entityContainer);
 	}
-	
-	
+
+
 	/**
 	 * {@inheritDoc}
 	 */
 	public void setSink(Sink sink) {
 		this.sink = sink;
 	}
-	
-	
+
+
 	/**
 	 * {@inheritDoc}
 	 */
 	public void complete() {
-		ReleasableIterator<EntityContainer> iterator = null;
-		
-		try {
-			iterator = fileBasedSort.iterate();
-			
+		try (ReleasableIterator<EntityContainer> iterator = fileBasedSort.iterate()) {
 			while (iterator.hasNext()) {
 				sink.process(iterator.next());
 			}
-			
+
 			sink.complete();
-		} finally {
-			if (iterator != null) {
-				iterator.release();
-			}
 		}
 	}
-	
-	
+
+
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		fileBasedSort.release();
-		sink.release();
+	public void close() {
+		fileBasedSort.close();
+		sink.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDeltaChangePipeValidator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDeltaChangePipeValidator.java
index c809a8c..e4d1213 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDeltaChangePipeValidator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDeltaChangePipeValidator.java
@@ -76,8 +76,8 @@ public class SortedDeltaChangePipeValidator implements ChangeSinkChangeSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		changeSink.release();
+	public void close() {
+		changeSink.close();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDuplicateEntityPipeValidator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDuplicateEntityPipeValidator.java
index fade67f..d8830e7 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDuplicateEntityPipeValidator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedDuplicateEntityPipeValidator.java
@@ -75,8 +75,8 @@ public class SortedDuplicateEntityPipeValidator implements SinkSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedEntityPipeValidator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedEntityPipeValidator.java
index 6e5b8d7..0b9dcd8 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedEntityPipeValidator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedEntityPipeValidator.java
@@ -74,8 +74,8 @@ public class SortedEntityPipeValidator implements SinkSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedHistoryChangePipeValidator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedHistoryChangePipeValidator.java
index 98b673b..e187650 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedHistoryChangePipeValidator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/SortedHistoryChangePipeValidator.java
@@ -77,8 +77,8 @@ public class SortedHistoryChangePipeValidator implements ChangeSinkChangeSource
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		changeSink.release();
+	public void close() {
+		changeSink.close();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/TagSorter.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/TagSorter.java
index f3bae18..d83460f 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/TagSorter.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/sort/v0_6/TagSorter.java
@@ -87,7 +87,7 @@ public class TagSorter implements SinkSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/BufferedRandomAccessFileInputStream.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/BufferedRandomAccessFileInputStream.java
index 2a0b671..5126dce 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/BufferedRandomAccessFileInputStream.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/BufferedRandomAccessFileInputStream.java
@@ -215,7 +215,7 @@ public class BufferedRandomAccessFileInputStream extends InputStream {
 		 * @throws FileNotFoundException
 		 *             if the file cannot be opened.
 		 */
-		public BufferedReader(
+		BufferedReader(
 				RandomAccessFile randomFile, int initialBufferSize,
 				int maxBufferSize, float bufferIncreaseFactor) {
 			this.randomFile = randomFile;
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ChunkedObjectStore.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ChunkedObjectStore.java
index 010921e..1443f3a 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ChunkedObjectStore.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ChunkedObjectStore.java
@@ -166,12 +166,12 @@ public class ChunkedObjectStore<T extends Storeable> implements Completable {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		objectStore.release();
+	public void close() {
+		objectStore.close();
 		if (indexStoreReader != null) {
-			indexStoreReader.release();
+			indexStoreReader.close();
 			indexStoreReader = null;
 		}
-		indexStore.release();
+		indexStore.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostbox.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostbox.java
index b0c4795..f70a1fd 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostbox.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostbox.java
@@ -340,13 +340,13 @@ public class DataPostbox<T> implements Initializable {
 
 	/**
 	 * This method conforms to the
-	 * {@link org.openstreetmap.osmosis.core.lifecycle.Releasable} contract,
+	 * {@link org.openstreetmap.osmosis.core.lifecycle.Closeable} contract,
 	 * however there are limitations around calling it multiple times. Each call
 	 * to this method must be matched by a call to the outputRelease method in a
 	 * separate thread or deadlock will occur.
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		lock.lock();
 
 		try {
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostboxLoadInjector.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostboxLoadInjector.java
index df6628f..6f19d02 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostboxLoadInjector.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/DataPostboxLoadInjector.java
@@ -73,7 +73,7 @@ public final class DataPostboxLoadInjector implements Runnable {
 		private Node node;
 		private NodeContainer nodeContainer;
 
-		public Writer() {
+		Writer() {
 			node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 3), 10, 10);
 			nodeContainer = new NodeContainer(node);
 		}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/EmptyIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/EmptyIterator.java
index 729fd52..bde1d85 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/EmptyIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/EmptyIterator.java
@@ -43,7 +43,7 @@ public class EmptyIterator<DataType> implements ReleasableIterator<DataType> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		// Nothing to do.
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStore.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStore.java
index 192377e..31ac46e 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStore.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStore.java
@@ -162,11 +162,9 @@ public class IndexStore<K, T extends IndexElement<K>> implements Completable {
 			if (!sorted) {
 				final Comparator<K> keyOrdering = ordering;
 				
-				FileBasedSort<T> fileSort;
-				
 				// Create a new file based sort instance ordering elements by their
 				// identifiers.
-				fileSort = new FileBasedSort<T>(
+				try (FileBasedSort<T> fileSort = new FileBasedSort<T>(
 					serializationFactory,
 					new Comparator<T>() {
 						private Comparator<K> elementKeyOrdering = keyOrdering;
@@ -177,15 +175,9 @@ public class IndexStore<K, T extends IndexElement<K>> implements Completable {
 						}
 					},
 					true
-				);
-				
-				try {
-					RandomAccessObjectStoreReader<T> indexStoreReader;
-					ReleasableIterator<T> sortIterator;
-					
+				)) {
 					// Read all data from the index store into the sorting store.
-					indexStoreReader = indexStore.createReader();
-					try {
+					try (RandomAccessObjectStoreReader<T> indexStoreReader = indexStore.createReader()) {
 						Iterator<T> indexIterator;
 						
 						indexIterator = indexStoreReader.iterate();
@@ -193,12 +185,10 @@ public class IndexStore<K, T extends IndexElement<K>> implements Completable {
 						while (indexIterator.hasNext()) {
 							fileSort.add(indexIterator.next());
 						}
-					} finally {
-						indexStoreReader.release();
 					}
 					
 					// Release the existing index store and create a new one.
-					indexStore.release();
+					indexStore.close();
 					if (indexFile != null) {
 						indexStore = new RandomAccessObjectStore<T>(serializationFactory, indexFile);
 					} else {
@@ -206,17 +196,12 @@ public class IndexStore<K, T extends IndexElement<K>> implements Completable {
 					}
 					
 					// Read all data from the sorting store back into the index store.
-					sortIterator = fileSort.iterate();
-					try {
+					try (ReleasableIterator<T> sortIterator = fileSort.iterate()) {
 						while (sortIterator.hasNext()) {
 							indexStore.add(sortIterator.next());
 						}
-					} finally {
-						sortIterator.release();
 					}
 					
-				} finally {
-					fileSort.release();
 				}
 			}
 			
@@ -228,7 +213,7 @@ public class IndexStore<K, T extends IndexElement<K>> implements Completable {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		indexStore.release();
+	public void close() {
+		indexStore.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStoreReader.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStoreReader.java
index 5be130d..f273108 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStoreReader.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexStoreReader.java
@@ -6,7 +6,7 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -22,7 +22,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  *            The object type being stored.
  * @author Brett Henderson
  */
-public class IndexStoreReader<K, T extends IndexElement<K>> implements Releasable {
+public class IndexStoreReader<K, T extends IndexElement<K>> implements Closeable {
 	private RandomAccessObjectStoreReader<T> indexStoreReader;
 	private Comparator<K> ordering;
 	private boolean elementDetailsInitialized;
@@ -230,8 +230,8 @@ public class IndexStoreReader<K, T extends IndexElement<K>> implements Releasabl
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		indexStoreReader.release();
+	public void close() {
+		indexStoreReader.close();
 	}
 	
 	
@@ -254,7 +254,7 @@ public class IndexStoreReader<K, T extends IndexElement<K>> implements Releasabl
 		 * @param key
 		 *            The key of the index element compared against.
 		 */
-		public ComparisonElement(long indexOffset, K key) {
+		ComparisonElement(long indexOffset, K key) {
 			this.indexOffset = indexOffset;
 			this.key = key;
 		}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStore.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStore.java
index 2036c19..54252d8 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStore.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStore.java
@@ -103,7 +103,7 @@ public class IndexedObjectStore<T extends Storeable> implements Completable {
 			
 		} finally {
 			if (objectStoreReader != null) {
-				objectStoreReader.release();
+				objectStoreReader.close();
 			}
 		}
 	}
@@ -122,8 +122,8 @@ public class IndexedObjectStore<T extends Storeable> implements Completable {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		objectStore.release();
-		indexStore.release();
+	public void close() {
+		objectStore.close();
+		indexStore.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStoreReader.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStoreReader.java
index 1e4be6a..4e7dd1a 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStoreReader.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/IndexedObjectStoreReader.java
@@ -1,7 +1,7 @@
 // This software is released into the Public Domain.  See copying.txt for details.
 package org.openstreetmap.osmosis.core.store;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -15,7 +15,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  *            The object type being stored.
  * @author Brett Henderson
  */
-public class IndexedObjectStoreReader<T> implements Releasable {
+public class IndexedObjectStoreReader<T> implements Closeable {
 	private RandomAccessObjectStoreReader<T> objectStoreReader;
 	private IndexStoreReader<Long, LongLongIndexElement> indexStoreReader;
 	
@@ -61,8 +61,8 @@ public class IndexedObjectStoreReader<T> implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		objectStoreReader.release();
-		indexStoreReader.release();
+	public void close() {
+		objectStoreReader.close();
+		indexStoreReader.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/MultipleSourceIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/MultipleSourceIterator.java
index cd0e1ea..2c731ce 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/MultipleSourceIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/MultipleSourceIterator.java
@@ -42,7 +42,7 @@ public class MultipleSourceIterator<T> implements ReleasableIterator<T> {
 			if (sources.get(0).hasNext()) {
 				return true;
 			} else {
-				sources.remove(0).release();
+				sources.remove(0).close();
 			}
 		}
 		
@@ -76,9 +76,9 @@ public class MultipleSourceIterator<T> implements ReleasableIterator<T> {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		for (ReleasableIterator<T> source : sources) {
-			source.release();
+			source.close();
 		}
 	}
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ObjectStreamIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ObjectStreamIterator.java
index 41a0d79..5b9027b 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ObjectStreamIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ObjectStreamIterator.java
@@ -41,7 +41,7 @@ public class ObjectStreamIterator<T> extends ObjectDataInputIterator<T> implemen
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (inStream != null) {
 			try {
 				inStream.close();
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PeekableIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PeekableIterator.java
index b7d4135..82f05ca 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PeekableIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PeekableIterator.java
@@ -78,8 +78,8 @@ public class PeekableIterator<T> implements ReleasableIterator<T> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sourceIterator.release();
+	public void close() {
+		sourceIterator.close();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PersistentIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PersistentIterator.java
index d217569..d27530b 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PersistentIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/PersistentIterator.java
@@ -55,7 +55,7 @@ public class PersistentIterator<T extends Storeable> implements ReleasableIterat
 			while (sourceIterator.hasNext()) {
 				store.add(sourceIterator.next());
 			}
-			sourceIterator.release();
+			sourceIterator.close();
 			sourceIterator = null;
 			
 			storeIterator = store.iterate();
@@ -90,16 +90,16 @@ public class PersistentIterator<T extends Storeable> implements ReleasableIterat
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (storeIterator != null) {
-			storeIterator.release();
+			storeIterator.close();
 			storeIterator = null;
 		}
 		
-		store.release();
+		store.close();
 		
 		if (sourceIterator != null) {
-			sourceIterator.release();
+			sourceIterator.close();
 			sourceIterator = null;
 		}
 	}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStore.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStore.java
index f31ae62..b3bf7cc 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStore.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStore.java
@@ -227,7 +227,7 @@ public class RandomAccessObjectStore<T extends Storeable> implements Completable
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (offsetTrackingStream != null) {
 			try {
 				offsetTrackingStream.close();
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStoreReader.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStoreReader.java
index 8d8cac1..2798b90 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStoreReader.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/RandomAccessObjectStoreReader.java
@@ -7,7 +7,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -21,7 +21,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  *            The object type being stored.
  * @author Brett Henderson
  */
-public class RandomAccessObjectStoreReader<T> implements Releasable {
+public class RandomAccessObjectStoreReader<T> implements Closeable {
 	private static final Logger LOG = Logger.getLogger(RandomAccessObjectStoreReader.class.getName());
 	
 	private BufferedRandomAccessFileInputStream randomFile;
@@ -130,7 +130,7 @@ public class RandomAccessObjectStoreReader<T> implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		if (randomFile != null) {
 			try {
 				randomFile.close();
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ReleasableAdaptorForIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ReleasableAdaptorForIterator.java
index 3700cb9..51dbfa8 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ReleasableAdaptorForIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/ReleasableAdaptorForIterator.java
@@ -61,7 +61,7 @@ public class ReleasableAdaptorForIterator<T> implements ReleasableIterator<T> {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SegmentedObjectStore.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SegmentedObjectStore.java
index 9b435a0..1356fde 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SegmentedObjectStore.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SegmentedObjectStore.java
@@ -321,7 +321,7 @@ public class SegmentedObjectStore<T extends Storeable> implements Completable {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (fileOutStream != null) {
 			try {
 				fileOutStream.close();
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SimpleObjectStore.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SimpleObjectStore.java
index b0d4e96..5ff41df 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SimpleObjectStore.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/SimpleObjectStore.java
@@ -217,7 +217,7 @@ public class SimpleObjectStore<T extends Storeable> implements Completable {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (fileOutStream != null) {
 			try {
 				fileOutStream.close();
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreReleasingIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreReleasingIterator.java
index eb2c2f1..fcefa44 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreReleasingIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreReleasingIterator.java
@@ -2,7 +2,7 @@
 package org.openstreetmap.osmosis.core.store;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.lifecycle.ReleasableIterator;
 
 
@@ -16,7 +16,7 @@ import org.openstreetmap.osmosis.core.lifecycle.ReleasableIterator;
  * @author Brett Henderson
  */
 public class StoreReleasingIterator<DataType> implements ReleasableIterator<DataType> {
-	private Releasable store;
+	private Closeable store;
 	private ReleasableIterator<DataType> iterator;
 	
 	
@@ -28,7 +28,7 @@ public class StoreReleasingIterator<DataType> implements ReleasableIterator<Data
 	 * @param store
 	 *            The store to be released after use.
 	 */
-	public StoreReleasingIterator(ReleasableIterator<DataType> iterator, Releasable store) {
+	public StoreReleasingIterator(ReleasableIterator<DataType> iterator, Closeable store) {
 		this.iterator = iterator;
 		this.store = store;
 	}
@@ -73,15 +73,15 @@ public class StoreReleasingIterator<DataType> implements ReleasableIterator<Data
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (iterator != null) {
-			iterator.release();
+			iterator.close();
 			
 			iterator = null;
 		}
 		
 		if (store != null) {
-			store.release();
+			store.close();
 			
 			store = null;
 		}
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreableConstructorCache.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreableConstructorCache.java
index 817db37..dd86642 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreableConstructorCache.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/StoreableConstructorCache.java
@@ -44,7 +44,7 @@ public class StoreableConstructorCache {
 			constructor = cache.get(clazz);
 		} else {
 			try {
-				constructor = clazz.getConstructor(new Class [] {StoreReader.class, StoreClassRegister.class});
+				constructor = clazz.getConstructor(new Class[] {StoreReader.class, StoreClassRegister.class});
 				
 			} catch (NoSuchMethodException e) {
 				throw new OsmosisRuntimeException(
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/UpcastIterator.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/UpcastIterator.java
index dac9d92..11602bd 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/UpcastIterator.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/store/UpcastIterator.java
@@ -62,7 +62,7 @@ public class UpcastIterator<X, Y extends X> implements ReleasableIterator<X> {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/task/v0_6/DatasetSink.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/task/v0_6/DatasetSink.java
index 5e7124d..2e82f4e 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/task/v0_6/DatasetSink.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/task/v0_6/DatasetSink.java
@@ -2,7 +2,7 @@
 package org.openstreetmap.osmosis.core.task.v0_6;
 
 import org.openstreetmap.osmosis.core.container.v0_6.Dataset;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.task.common.Task;
 
 
@@ -11,7 +11,7 @@ import org.openstreetmap.osmosis.core.task.common.Task;
  * 
  * @author Brett Henderson
  */
-public interface DatasetSink extends Task, Releasable {
+public interface DatasetSink extends Task, Closeable {
 	
 	/**
 	 * Process the dataset. This must only be called once. This will perform all
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/ChangeTee.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/ChangeTee.java
index 2b8376c..e488559 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/ChangeTee.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/ChangeTee.java
@@ -96,9 +96,9 @@ public class ChangeTee implements ChangeSinkMultiChangeSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		for (ProxyChangeSinkChangeSource sink : sinkList) {
-			sink.release();
+			sink.close();
 		}
 	}
 	
@@ -115,7 +115,7 @@ public class ChangeTee implements ChangeSinkMultiChangeSource {
 		/**
 		 * Creates a new instance.
 		 */
-		public ProxyChangeSinkChangeSource() {
+		ProxyChangeSinkChangeSource() {
 			// Nothing to do.
 		}
 		
@@ -155,8 +155,8 @@ public class ChangeTee implements ChangeSinkMultiChangeSource {
 		/**
 		 * {@inheritDoc}
 		 */
-		public void release() {
-			changeSink.release();
+		public void close() {
+			changeSink.close();
 		}
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/EntityTee.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/EntityTee.java
index 0be8f9a..76c5334 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/EntityTee.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/tee/v0_6/EntityTee.java
@@ -96,9 +96,9 @@ public class EntityTee implements SinkMultiSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		for (ProxySinkSource sink : sinkList) {
-			sink.release();
+			sink.close();
 		}
 	}
 	
@@ -115,7 +115,7 @@ public class EntityTee implements SinkMultiSource {
 		/**
 		 * Creates a new instance.
 		 */
-		public ProxySinkSource() {
+		ProxySinkSource() {
 			// Nothing to do.
 		}
 		
@@ -155,8 +155,8 @@ public class EntityTee implements SinkMultiSource {
 		/**
 		 * {@inheritDoc}
 		 */
-		public void release() {
-			sink.release();
+		public void close() {
+			sink.close();
 		}		
 	}
 }
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/FileBasedLock.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/FileBasedLock.java
index 251c9ee..c708c9d 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/FileBasedLock.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/FileBasedLock.java
@@ -9,7 +9,7 @@ import java.nio.channels.FileLock;
 import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -18,7 +18,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public class FileBasedLock implements Releasable {
+public class FileBasedLock implements Closeable {
 	
 	private static final Logger LOG = Logger.getLogger(FileBasedLock.class.getName());
 	
@@ -103,7 +103,7 @@ public class FileBasedLock implements Releasable {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (outputStream != null) {
 			try {
 				outputStream.close();
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/PropertiesPersister.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/PropertiesPersister.java
index aa6aab4..e9fbb7b 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/PropertiesPersister.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/PropertiesPersister.java
@@ -15,8 +15,6 @@ import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 
@@ -26,9 +24,6 @@ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
  */
 public class PropertiesPersister {
 	
-	private static final Logger LOG = Logger.getLogger(PropertiesPersister.class.getName());
-	
-	
 	private AtomicFileCreator atomicFileCreator;
 	
 	
@@ -49,35 +44,20 @@ public class PropertiesPersister {
 	 * @return The properties.
 	 */
 	public Properties load() {
-
-		FileInputStream fileInputStream = null;
-		
-		try {
+		try (FileInputStream fileInputStream = new FileInputStream(atomicFileCreator.getFile())) {
 			Reader reader;
 			Properties properties;
 			
-			fileInputStream = new FileInputStream(atomicFileCreator.getFile());
 			reader = new InputStreamReader(new BufferedInputStream(fileInputStream), Charset.forName("UTF-8"));
 			
 			properties = new Properties();
 			properties.load(reader);
 			
-			fileInputStream.close();
-			fileInputStream = null;
-			
 			return properties;
 			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read the properties from file " + atomicFileCreator.getFile()
 					+ ".", e);
-		} finally {
-			if (fileInputStream != null) {
-				try {
-					fileInputStream.close();
-				} catch (Exception e) {
-					LOG.log(Level.WARNING, "Unable to close properties file " + atomicFileCreator.getFile() + ".", e);
-				}
-			}
 		}
 	}
 	
@@ -100,33 +80,21 @@ public class PropertiesPersister {
 	 *            The properties.
 	 */
 	public void store(Properties properties) {
-		FileOutputStream fileOutputStream = null;
-		
-		try {
+		try (FileOutputStream fileOutputStream = new FileOutputStream(atomicFileCreator.getTmpFile())) {
 			Writer writer;
 			
-			fileOutputStream = new FileOutputStream(atomicFileCreator.getTmpFile());
 			writer = new OutputStreamWriter(new BufferedOutputStream(fileOutputStream));
 			
 			properties.store(writer, null);
 			
 			writer.close();
 			
-			atomicFileCreator.renameTmpFileToCurrent();
-			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException(
 					"Unable to write the properties to temporary file " + atomicFileCreator.getTmpFile() + ".", e);
-		} finally {
-			if (fileOutputStream != null) {
-				try {
-					fileOutputStream.close();
-				} catch (Exception e) {
-					LOG.log(Level.WARNING, "Unable to close temporary state file " + atomicFileCreator.getTmpFile()
-							+ ".", e);
-				}
-			}
 		}
+
+		atomicFileCreator.renameTmpFileToCurrent();
 	}
 	
 	
diff --git a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/ResourceFileManager.java b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/ResourceFileManager.java
index accaf81..4cac5f1 100644
--- a/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/ResourceFileManager.java
+++ b/osmosis-core/src/main/java/org/openstreetmap/osmosis/core/util/ResourceFileManager.java
@@ -7,7 +7,6 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 
@@ -19,9 +18,6 @@ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
  */
 public class ResourceFileManager {
 	
-	private static final Logger LOG = Logger.getLogger(ResourceFileManager.class.getName());
-	
-	
 	/**
 	 * Copies a packaged resource to a file on the file system.
 	 * 
@@ -34,54 +30,29 @@ public class ResourceFileManager {
 	 *            The output file.
 	 */
 	public void copyResourceToFile(Class<?> callingClass, String sourceResource, File destinationFile) {
-		InputStream is = null;
-		OutputStream os = null;
+		byte[] buffer = new byte[4096];
 		
-		try {
-			byte[] buffer;
-			int bytesRead;
-			
-			buffer = new byte[4096];
-			
-			is = callingClass.getResourceAsStream(sourceResource);
-			os = new FileOutputStream(destinationFile);
-			
+		try (InputStream is = callingClass.getResourceAsStream(sourceResource)) {
 			if (is == null) {
 			    throw new FileNotFoundException("Could not find " + sourceResource);
 			}
-			
-			while (true) {
-				bytesRead = is.read(buffer);
-				
-				// Stop reading if no more data is available.
-				if (bytesRead < 0) {
-					break;
+
+			try (OutputStream os = new FileOutputStream(destinationFile)) {
+				while (true) {
+					int bytesRead = is.read(buffer);
+					
+					// Stop reading if no more data is available.
+					if (bytesRead < 0) {
+						break;
+					}
+					
+					os.write(buffer, 0, bytesRead);
 				}
-				
-				os.write(buffer, 0, bytesRead);
 			}
 			
-			is.close();
-			os.close();
-			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException(
 					"Unable to copy resource " + sourceResource + " to file " + destinationFile);
-		} finally {
-			if (is != null) {
-				try {
-					is.close();
-				} catch (Exception e) {
-					LOG.warning("Unable to close input stream for resource " + sourceResource);
-				}
-			}
-			if (os != null) {
-				try {
-					os.close();
-				} catch (Exception e) {
-					LOG.warning("Unable to close output stream for file " + destinationFile);
-				}
-			}
 		}
 	}
 }
diff --git a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputerTest.java b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputerTest.java
index c5e7bfb..a70dffd 100644
--- a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputerTest.java
+++ b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputerTest.java
@@ -33,7 +33,7 @@ public class BoundComputerTest {
 		BoundComputer bc = new BoundComputer("NewBound");
 		bc.setSink(inspector);
 		bc.complete();
-		bc.release();
+		bc.close();
 
 		Assert.assertNull(inspector.getLastEntityContainer());
 	}
@@ -49,7 +49,7 @@ public class BoundComputerTest {
 		bc.setSink(inspector);
 		bc.process(new BoundContainer(new Bound("Test")));
 		bc.complete();
-		bc.release();
+		bc.close();
 
 		Assert.assertNull(inspector.getLastEntityContainer());
 	}
@@ -66,7 +66,7 @@ public class BoundComputerTest {
 		bc.process(new NodeContainer(new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
 		bc.process(new NodeContainer(new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 1), 2, 2)));
 		bc.complete();
-		bc.release();
+		bc.close();
 
 		EntityContainer ec = inspector.getProcessedEntities().iterator().next();
 		Assert.assertEquals(new Bound(2, 1, 2, 1, "NewBound"), ec.getEntity());
@@ -84,7 +84,7 @@ public class BoundComputerTest {
 		bc.process(new NodeContainer(new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
 		bc.process(new NodeContainer(new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 1), 2, 2)));
 		bc.complete();
-		bc.release();
+		bc.close();
 
 		Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
 		EntityContainer ec = iterator.next();
diff --git a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetterTest.java b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetterTest.java
index 3cbd1d2..868d99b 100644
--- a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetterTest.java
+++ b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetterTest.java
@@ -35,7 +35,7 @@ public class BoundSetterTest {
 		setter.process(new NodeContainer(new Node(
 				new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
 		setter.complete();
-		setter.release();
+		setter.close();
 		
 		EntityContainer ec = inspector.getProcessedEntities().iterator().next();
 		Assert.assertEquals(EntityType.Node, ec.getEntity().getType());
@@ -52,7 +52,7 @@ public class BoundSetterTest {
 		setter.process(new NodeContainer(new Node(
 				new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
 		setter.complete();
-		setter.release();
+		setter.close();
 		
 		EntityContainer ec = inspector.getProcessedEntities().iterator().next();
 		Assert.assertEquals(EntityType.Node, ec.getEntity().getType());
@@ -71,7 +71,7 @@ public class BoundSetterTest {
 		setter.process(new NodeContainer(new Node(
 				new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
 		setter.complete();
-		setter.release();
+		setter.close();
 		
 		Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
 		EntityContainer ec = iterator.next();
@@ -96,7 +96,7 @@ public class BoundSetterTest {
 		setter.process(new NodeContainer(new Node(
 				new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
 		setter.complete();
-		setter.release();
+		setter.close();
 		
 		EntityContainer ec = inspector.getProcessedEntities().iterator().next();
 		Assert.assertEquals(EntityType.Bound, ec.getEntity().getType());
diff --git a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/cli/CommandLineParserTest.java b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/cli/CommandLineParserTest.java
index 7d9757c..3843a51 100644
--- a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/cli/CommandLineParserTest.java
+++ b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/cli/CommandLineParserTest.java
@@ -25,22 +25,22 @@ public class CommandLineParserTest {
 		CommandLineParser commandLineParser;
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {});
+		commandLineParser.parse(new String[] {});
 		Assert.assertEquals("Incorrect default log level.", Level.INFO,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-q"});
+		commandLineParser.parse(new String[] {"-q"});
 		Assert.assertEquals("Incorrect quiet log level.", Level.WARNING,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-q", "1"});
+		commandLineParser.parse(new String[] {"-q", "1"});
 		Assert.assertEquals("Incorrect very quiet log level.", Level.SEVERE,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-q", "2"});
+		commandLineParser.parse(new String[] {"-q", "2"});
 		Assert.assertEquals("Incorrect very very quiet log level.", Level.OFF,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 	}
@@ -54,27 +54,27 @@ public class CommandLineParserTest {
 		CommandLineParser commandLineParser;
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {});
+		commandLineParser.parse(new String[] {});
 		Assert.assertEquals("Incorrect default log level.", Level.INFO,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-v"});
+		commandLineParser.parse(new String[] {"-v"});
 		Assert.assertEquals("Incorrect verbose log level.", Level.FINE,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-v", "1"});
+		commandLineParser.parse(new String[] {"-v", "1"});
 		Assert.assertEquals("Incorrect very verbose log level.", Level.FINER,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-v", "2"});
+		commandLineParser.parse(new String[] {"-v", "2"});
 		Assert.assertEquals("Incorrect very very verbose log level.", Level.FINEST,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-v", "3"});
+		commandLineParser.parse(new String[] {"-v", "3"});
 		Assert.assertEquals(
 				"Incorrect very very very verbose log level.",
 				Level.FINEST,
@@ -90,22 +90,22 @@ public class CommandLineParserTest {
 		CommandLineParser commandLineParser;
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {});
+		commandLineParser.parse(new String[] {});
 		Assert.assertEquals("Incorrect default log level.", Level.INFO,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-v", "-q"});
+		commandLineParser.parse(new String[] {"-v", "-q"});
 		Assert.assertEquals("Incorrect default log level.", Level.INFO,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-v", "1", "-q", "1"});
+		commandLineParser.parse(new String[] {"-v", "1", "-q", "1"});
 		Assert.assertEquals("Incorrect default log level.", Level.INFO,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-v", "1", "-q", "2"});
+		commandLineParser.parse(new String[] {"-v", "1", "-q", "2"});
 		Assert.assertEquals("Incorrect quiet log level.", Level.WARNING,
 				LogLevels.getLogLevel(commandLineParser.getLogLevelIndex()));
 	}
@@ -119,7 +119,7 @@ public class CommandLineParserTest {
 		CommandLineParser commandLineParser;
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-p", "plugin1", "-p", "plugin2"});
+		commandLineParser.parse(new String[] {"-p", "plugin1", "-p", "plugin2"});
 		Assert.assertEquals(
 				"Incorrect plugin list.",
 				Arrays.asList("plugin1", "plugin2"),
@@ -135,6 +135,6 @@ public class CommandLineParserTest {
 		CommandLineParser commandLineParser;
 		
 		commandLineParser = new CommandLineParser();
-		commandLineParser.parse(new String [] {"-a"});
+		commandLineParser.parse(new String[] {"-a"});
 	}
 }
diff --git a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSortTest.java b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSortTest.java
index 3c7777f..f5b3315 100644
--- a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSortTest.java
+++ b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/sort/common/FileBasedSortTest.java
@@ -46,10 +46,9 @@ public class FileBasedSortTest {
 				}
 			}
 		};
-		FileBasedSort<SampleStoreable> fileBasedSort =
-				new FileBasedSort<SampleStoreable>(objectFactory, comparator, true);
 
-		try {
+		try (FileBasedSort<SampleStoreable> fileBasedSort =
+				new FileBasedSort<SampleStoreable>(objectFactory, comparator, true)) {
 			// Add randomly generated test values into the sorter.
 			Random random = new Random();
 			for (long i = 0; i < itemCount; i++) {
@@ -58,20 +57,14 @@ public class FileBasedSortTest {
 
 			// Read back all values in the sorter and verify that they are
 			// sorted correctly.
-			ReleasableIterator<SampleStoreable> resultIterator = fileBasedSort.iterate();
-			try {
+			try (ReleasableIterator<SampleStoreable> resultIterator = fileBasedSort.iterate()) {
 				int lastValue = Integer.MIN_VALUE;
 				while (resultIterator.hasNext()) {
 					int currentValue = resultIterator.next().getValue();
 					Assert.assertTrue(currentValue >= lastValue);
 					lastValue = currentValue;
 				}
-			} finally {
-				resultIterator.release();
 			}
-
-		} finally {
-			fileBasedSort.release();
 		}
 	}
 }
diff --git a/osmosis-core/src/test/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java b/osmosis-core/src/test/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java
index 616ebc1..c117671 100644
--- a/osmosis-core/src/test/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java
+++ b/osmosis-core/src/test/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java
@@ -60,7 +60,7 @@ public class SinkEntityInspector implements Sink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Nothing to do here
 	}
 
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DatasetBoundingBoxFilter.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DatasetBoundingBoxFilter.java
index a00a94d..783ac00 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DatasetBoundingBoxFilter.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DatasetBoundingBoxFilter.java
@@ -68,8 +68,6 @@ public class DatasetBoundingBoxFilter implements DatasetSinkSource {
 	 */
 	@Override
 	public void process(Dataset dataset) {
-		ReleasableIterator<EntityContainer> bboxData;
-		
 		if (datasetReader != null) {
 			throw new OsmosisRuntimeException("process may only be invoked once.");
 		}
@@ -77,8 +75,9 @@ public class DatasetBoundingBoxFilter implements DatasetSinkSource {
 		datasetReader = dataset.createReader();
 		
 		// Pass all data within the bounding box to the sink.
-		bboxData = datasetReader.iterateBoundingBox(left, right, top, bottom, completeWays);
-		try {
+		try (ReleasableIterator<EntityContainer> bboxData =
+				datasetReader.iterateBoundingBox(left, right, top, bottom, completeWays)) {
+
 			sink.initialize(Collections.<String, Object>emptyMap());
 			
 			while (bboxData.hasNext()) {
@@ -87,8 +86,6 @@ public class DatasetBoundingBoxFilter implements DatasetSinkSource {
 			
 			sink.complete();
 			
-		} finally {
-			bboxData.release();
 		}
 	}
 	
@@ -97,11 +94,11 @@ public class DatasetBoundingBoxFilter implements DatasetSinkSource {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 		
 		if (datasetReader != null) {
-			datasetReader.release();
+			datasetReader.close();
 		}
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DumpDataset.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DumpDataset.java
index f51740e..fa8ddaa 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DumpDataset.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/DumpDataset.java
@@ -36,8 +36,6 @@ public class DumpDataset implements DatasetSinkSource {
 	 */
 	@Override
 	public void process(Dataset dataset) {
-		ReleasableIterator<EntityContainer> bboxData;
-		
 		if (datasetReader != null) {
 			throw new OsmosisRuntimeException("process may only be invoked once.");
 		}
@@ -45,8 +43,7 @@ public class DumpDataset implements DatasetSinkSource {
 		datasetReader = dataset.createReader();
 		
 		// Pass all data within the dataset to the sink.
-		bboxData = datasetReader.iterate();
-		try {
+		try (ReleasableIterator<EntityContainer> bboxData = datasetReader.iterate()) {
 			sink.initialize(Collections.<String, Object>emptyMap());
 			
 			while (bboxData.hasNext()) {
@@ -55,8 +52,6 @@ public class DumpDataset implements DatasetSinkSource {
 			
 			sink.complete();
 			
-		} finally {
-			bboxData.release();
 		}
 	}
 	
@@ -65,11 +60,11 @@ public class DumpDataset implements DatasetSinkSource {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 		
 		if (datasetReader != null) {
-			datasetReader.release();
+			datasetReader.close();
 		}
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/ReadDataset.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/ReadDataset.java
index 9daeff8..ba687c3 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/ReadDataset.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/ReadDataset.java
@@ -55,8 +55,8 @@ public class ReadDataset implements RunnableDatasetSource {
 			datasetSink.process(store);
 			
 		} finally {
-			datasetSink.release();
-			store.release();
+			datasetSink.close();
+			store.close();
 		}
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/WriteDataset.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/WriteDataset.java
index c69ee5e..c712390 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/WriteDataset.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/WriteDataset.java
@@ -65,13 +65,13 @@ public class WriteDataset implements Sink {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		// We must release the store last because downstream tasks must be able
 		// to release store readers first.
-		store.release();
+		store.close();
 		
 		// We must release the file manager after the store to ensure all open
 		// files are closed.
-		fileManager.release();
+		fileManager.close();
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStore.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStore.java
index 2d5589a..7f935fc 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStore.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStore.java
@@ -103,7 +103,7 @@ public class DatasetStore implements Sink, EntityProcessor, Dataset {
 			}
 			
 			@Override
-			public void release() {
+			public void close() {
 				throw new UnsupportedOperationException();
 			} });
 		
@@ -400,9 +400,7 @@ public class DatasetStore implements Sink, EntityProcessor, Dataset {
 	 */
 	@Override
 	public DatasetContext createReader() {
-		ReleasableContainer releasableContainer = new ReleasableContainer();
-		
-		try {
+		try (ReleasableContainer releasableContainer = new ReleasableContainer()) {
 			DatasetContext reader;
 			
 			reader = new DatasetStoreReader(
@@ -428,9 +426,6 @@ public class DatasetStore implements Sink, EntityProcessor, Dataset {
 			releasableContainer.clear();
 			
 			return reader;
-			
-		} finally {
-			releasableContainer.release();
 		}
 	}
 	
@@ -438,14 +433,14 @@ public class DatasetStore implements Sink, EntityProcessor, Dataset {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (nodeObjectReader != null) {
-			nodeObjectReader.release();
+			nodeObjectReader.close();
 		}
 		if (nodeObjectOffsetIndexReader != null) {
-			nodeObjectOffsetIndexReader.release();
+			nodeObjectOffsetIndexReader.close();
 		}
 		
-		storeContainer.release();
+		storeContainer.close();
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreFileManager.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreFileManager.java
index dfb37aa..c956205 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreFileManager.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreFileManager.java
@@ -3,7 +3,7 @@ package org.openstreetmap.osmosis.dataset.v0_6.impl;
 
 import java.io.File;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -11,7 +11,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public interface DatasetStoreFileManager extends Releasable {
+public interface DatasetStoreFileManager extends Closeable {
 	/**
 	 * Returns the file to be used for storing node objects.
 	 * 
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreReader.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreReader.java
index f5d19a1..c1f4538 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreReader.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/DatasetStoreReader.java
@@ -284,7 +284,6 @@ public class DatasetStoreReader implements DatasetContext {
 	 *            The bounding box data.
 	 */
 	private void populateNodeIds(BoundingBoxContext bboxCtx) {
-		ReleasableIterator<Long> nodeIdsForTileset;
 		IdTracker idTracker;
 		
 		idTracker = new DynamicIdTracker();
@@ -293,16 +292,13 @@ public class DatasetStoreReader implements DatasetContext {
 		// temporary id tracker. This temporary id tracker allows all node ids
 		// to be sorted ascendingly prior to retrieving the nodes themselves
 		// which improves index performance.
-		nodeIdsForTileset = getNodeIdsForTileRange(bboxCtx.minimumTile, bboxCtx.maximumTile);
-		try {
+		try (ReleasableIterator<Long> nodeIdsForTileset =
+					 getNodeIdsForTileRange(bboxCtx.minimumTile, bboxCtx.maximumTile)) {
 			while (nodeIdsForTileset.hasNext()) {
 				idTracker.set(nodeIdsForTileset.next());
 			}
-			
-		} finally {
-			nodeIdsForTileset.release();
 		}
-		
+
 		// Check to see whether each applicable node lies within the bounding
 		// box and add them to the result id list if they are.
 		for (long nodeId : idTracker) {
@@ -325,12 +321,10 @@ public class DatasetStoreReader implements DatasetContext {
 	 *            The bounding box data.
 	 */
 	private void populateWayIdsUsingTileWayIndex(BoundingBoxContext bboxCtx, boolean completeWays) {
-		ReleasableIterator<Long> tileWayIndexValues;
-		
 		// Search through all ways in the tile range and store the ids of those
 		// within the bounding box.
-		tileWayIndexValues = getWayIdsForTileRange(bboxCtx.minimumTile, bboxCtx.maximumTile);
-		try {
+		try (ReleasableIterator<Long> tileWayIndexValues =
+					 getWayIdsForTileRange(bboxCtx.minimumTile, bboxCtx.maximumTile)) {
 			while (tileWayIndexValues.hasNext()) {
 				long wayId;
 				Way way;
@@ -376,8 +370,6 @@ public class DatasetStoreReader implements DatasetContext {
 					}
 				}
 			}
-		} finally {
-			tileWayIndexValues.release();
 		}
 	}
 	
@@ -393,14 +385,10 @@ public class DatasetStoreReader implements DatasetContext {
 	private void populateWayIdsUsingNodeWayIndex(BoundingBoxContext bboxCtx, boolean completeWays) {
 		// Select all ways that contain the currently selected nodes.
 		for (Long nodeId : bboxCtx.nodeIdTracker) {
-			ReleasableIterator<Long> wayIdIterator = getWayIdsOwningNode(nodeId);
-			try {
+			try (ReleasableIterator<Long> wayIdIterator = getWayIdsOwningNode(nodeId)) {
 				while (wayIdIterator.hasNext()) {
 					bboxCtx.wayIdTracker.set(wayIdIterator.next());
 				}
-				
-			} finally {
-				wayIdIterator.release();
 			}
 		}
 		
@@ -440,25 +428,19 @@ public class DatasetStoreReader implements DatasetContext {
 	private void populateRelationIds(BoundingBoxContext bboxCtx) {
 		// Select all relations that contain the currently selected nodes, ways and relations.
 		for (Long nodeId : bboxCtx.nodeIdTracker) {
-			ReleasableIterator<Long> relationIdIterator = getRelationIdsOwningNode(nodeId);
-			try {
+			try (ReleasableIterator<Long> relationIdIterator = getRelationIdsOwningNode(nodeId)) {
 				while (relationIdIterator.hasNext()) {
 					bboxCtx.relationIdTracker.set(relationIdIterator.next());
 				}
 				
-			} finally {
-				relationIdIterator.release();
 			}
 		}
 		for (Long wayId : bboxCtx.wayIdTracker) {
-			ReleasableIterator<Long> relationIdIterator = getRelationIdsOwningWay(wayId);
-			try {
+			try (ReleasableIterator<Long> relationIdIterator = getRelationIdsOwningWay(wayId)) {
 				while (relationIdIterator.hasNext()) {
 					bboxCtx.relationIdTracker.set(relationIdIterator.next());
 				}
 				
-			} finally {
-				relationIdIterator.release();
 			}
 		}
 		for (boolean moreParents = true; moreParents;) {
@@ -467,8 +449,7 @@ public class DatasetStoreReader implements DatasetContext {
 			moreParents = false;
 			
 			for (Long relationId : bboxCtx.relationIdTracker) {
-				ReleasableIterator<Long> relationIdIterator = getRelationIdsOwningRelation(relationId);
-				try {
+				try (ReleasableIterator<Long> relationIdIterator = getRelationIdsOwningRelation(relationId)) {
 					while (relationIdIterator.hasNext()) {
 						long parentRelationId;
 						
@@ -480,8 +461,6 @@ public class DatasetStoreReader implements DatasetContext {
 						}
 					}
 					
-				} finally {
-					relationIdIterator.release();
 				}
 			}
 		}
@@ -554,7 +533,7 @@ public class DatasetStoreReader implements DatasetContext {
 		 * @param relationIdList
 		 *            The set of relations to be returned.
 		 */
-		public ResultIterator(IdTracker nodeIdList, IdTracker wayIdList, IdTracker relationIdList) {
+		ResultIterator(IdTracker nodeIdList, IdTracker wayIdList, IdTracker relationIdList) {
 			nodeIds = nodeIdList.iterator();
 			wayIds = wayIdList.iterator();
 			relationIds = relationIdList.iterator();
@@ -602,7 +581,7 @@ public class DatasetStoreReader implements DatasetContext {
 		 * {@inheritDoc}
 		 */
 		@Override
-		public void release() {
+		public void close() {
 			// Do nothing.
 		}
 	}
@@ -621,9 +600,9 @@ public class DatasetStoreReader implements DatasetContext {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		nodeStorageContainer.release();
-		wayStorageContainer.release();
-		relationStorageContainer.release();
+	public void close() {
+		nodeStorageContainer.close();
+		wayStorageContainer.close();
+		relationStorageContainer.close();
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/NodeStorageContainer.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/NodeStorageContainer.java
index 79a1f60..bfbffa9 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/NodeStorageContainer.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/NodeStorageContainer.java
@@ -2,7 +2,7 @@
 package org.openstreetmap.osmosis.dataset.v0_6.impl;
 
 import org.openstreetmap.osmosis.core.domain.v0_6.Node;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.lifecycle.ReleasableContainer;
 import org.openstreetmap.osmosis.core.store.IndexStoreReader;
 import org.openstreetmap.osmosis.core.store.IntegerLongIndexElement;
@@ -14,7 +14,7 @@ import org.openstreetmap.osmosis.core.store.RandomAccessObjectStoreReader;
  * 
  * @author Brett Henderson
  */
-public class NodeStorageContainer implements Releasable {
+public class NodeStorageContainer implements Closeable {
 	private ReleasableContainer releasableContainer;
 	private RandomAccessObjectStoreReader<Node> nodeObjectReader;
 	private IndexStoreReader<Long, LongLongIndexElement> nodeObjectOffsetIndexReader;
@@ -108,7 +108,7 @@ public class NodeStorageContainer implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		releasableContainer.release();
+	public void close() {
+		releasableContainer.close();
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/PermanentFileDatasetStoreFileManager.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/PermanentFileDatasetStoreFileManager.java
index 42b0fd7..231c8a3 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/PermanentFileDatasetStoreFileManager.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/PermanentFileDatasetStoreFileManager.java
@@ -214,7 +214,7 @@ public class PermanentFileDatasetStoreFileManager implements DatasetStoreFileMan
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationStorageContainer.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationStorageContainer.java
index 42687cc..cce7992 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationStorageContainer.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationStorageContainer.java
@@ -2,7 +2,7 @@
 package org.openstreetmap.osmosis.dataset.v0_6.impl;
 
 import org.openstreetmap.osmosis.core.domain.v0_6.Relation;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.lifecycle.ReleasableContainer;
 import org.openstreetmap.osmosis.core.store.IndexStoreReader;
 import org.openstreetmap.osmosis.core.store.LongLongIndexElement;
@@ -14,7 +14,7 @@ import org.openstreetmap.osmosis.core.store.RandomAccessObjectStoreReader;
  * 
  * @author Brett Henderson
  */
-public class RelationStorageContainer implements Releasable {
+public class RelationStorageContainer implements Closeable {
 	private ReleasableContainer releasableContainer;
 	private RandomAccessObjectStoreReader<Relation> relationObjectReader;
 	private IndexStoreReader<Long, LongLongIndexElement> relationObjectOffsetIndexReader;
@@ -77,7 +77,7 @@ public class RelationStorageContainer implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		releasableContainer.release();
+	public void close() {
+		releasableContainer.close();
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationalIndexValueIdIterator.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationalIndexValueIdIterator.java
index 253d90f..d04f5a0 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationalIndexValueIdIterator.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/RelationalIndexValueIdIterator.java
@@ -59,7 +59,7 @@ public class RelationalIndexValueIdIterator implements ReleasableIterator<Long>
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TempFileDatasetStoreFileManager.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TempFileDatasetStoreFileManager.java
index 5dc59f9..ca0f629 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TempFileDatasetStoreFileManager.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TempFileDatasetStoreFileManager.java
@@ -229,7 +229,7 @@ public class TempFileDatasetStoreFileManager implements DatasetStoreFileManager
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		for (File file : allFiles) {
 			if (!file.delete()) {
 				log.warning("Unable to delete file " + file);
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TileIndexValueIdIterator.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TileIndexValueIdIterator.java
index f782302..93a174a 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TileIndexValueIdIterator.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/TileIndexValueIdIterator.java
@@ -59,7 +59,7 @@ public class TileIndexValueIdIterator implements ReleasableIterator<Long> {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayStorageContainer.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayStorageContainer.java
index 1b7ed7d..0d20e93 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayStorageContainer.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayStorageContainer.java
@@ -2,7 +2,7 @@
 package org.openstreetmap.osmosis.dataset.v0_6.impl;
 
 import org.openstreetmap.osmosis.core.domain.v0_6.Way;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.lifecycle.ReleasableContainer;
 import org.openstreetmap.osmosis.core.store.IndexStoreReader;
 import org.openstreetmap.osmosis.core.store.LongLongIndexElement;
@@ -14,7 +14,7 @@ import org.openstreetmap.osmosis.core.store.RandomAccessObjectStoreReader;
  * 
  * @author Brett Henderson
  */
-public class WayStorageContainer implements Releasable {
+public class WayStorageContainer implements Closeable {
 	private ReleasableContainer releasableContainer;
 	private RandomAccessObjectStoreReader<Way> wayObjectReader;
 	private IndexStoreReader<Long, LongLongIndexElement> wayObjectOffsetIndexReader;
@@ -92,7 +92,7 @@ public class WayStorageContainer implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		releasableContainer.release();
+	public void close() {
+		releasableContainer.close();
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndex.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndex.java
index c2d6e40..f42dd17 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndex.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndex.java
@@ -5,7 +5,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.openstreetmap.osmosis.core.lifecycle.Completable;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.lifecycle.ReleasableContainer;
 import org.openstreetmap.osmosis.core.store.IndexStore;
 import org.openstreetmap.osmosis.core.store.IndexStoreReader;
@@ -84,9 +84,7 @@ public class WayTileAreaIndex implements Completable {
 	 * @return An index reader.
 	 */
 	public WayTileAreaIndexReader createReader() {
-		ReleasableContainer releasableContainer = new ReleasableContainer();
-		
-		try {
+		try (ReleasableContainer releasableContainer = new ReleasableContainer()) {
 			List<IndexStoreReader<Integer, IntegerLongIndexElement>> indexReaders;
 			
 			indexReaders = new ArrayList<IndexStoreReader<Integer, IntegerLongIndexElement>>(MASKS.length);
@@ -97,9 +95,6 @@ public class WayTileAreaIndex implements Completable {
 			releasableContainer.clear();
 			
 			return new WayTileAreaIndexReader(MASKS, indexReaders);
-			
-		} finally {
-			releasableContainer.release();
 		}
 	}
 	
@@ -119,9 +114,9 @@ public class WayTileAreaIndex implements Completable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		for (Releasable index : indexes) {
-			index.release();
+	public void close() {
+		for (Closeable index : indexes) {
+			index.close();
 		}
 	}
 }
diff --git a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndexReader.java b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndexReader.java
index c019d8f..df1b0c3 100644
--- a/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndexReader.java
+++ b/osmosis-dataset/src/main/java/org/openstreetmap/osmosis/dataset/v0_6/impl/WayTileAreaIndexReader.java
@@ -6,7 +6,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.core.store.IndexStoreReader;
 import org.openstreetmap.osmosis.core.store.IntegerLongIndexElement;
 
@@ -19,7 +19,7 @@ import org.openstreetmap.osmosis.core.store.IntegerLongIndexElement;
  * 
  * @author Brett Henderson
  */
-public class WayTileAreaIndexReader implements Releasable {
+public class WayTileAreaIndexReader implements Closeable {
 	private int[] masks = {0xFFFFFFFF, 0xFFFFFFF0, 0xFFFFFF00, 0xFFFF0000, 0xFF000000, 0x00000000};
 	private List<IndexStoreReader<Integer, IntegerLongIndexElement>> indexReaders;
 	
@@ -77,9 +77,9 @@ public class WayTileAreaIndexReader implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		for (IndexStoreReader<Integer, IntegerLongIndexElement> indexReader : indexReaders) {
-			indexReader.release();
+			indexReader.close();
 		}
 	}
 	
@@ -102,7 +102,7 @@ public class WayTileAreaIndexReader implements Releasable {
 		 * @param sources
 		 *            The input sources.
 		 */
-		public ResultIterator(Iterator<Iterator<IntegerLongIndexElement>> sources) {
+		ResultIterator(Iterator<Iterator<IntegerLongIndexElement>> sources) {
 			this.sources = sources;
 			
 			currentSourceAvailable = false;
diff --git a/osmosis-dataset/src/test/java/org/openstreetmap/osmosis/dataset/v0_6/CustomDbTest.java b/osmosis-dataset/src/test/java/org/openstreetmap/osmosis/dataset/v0_6/CustomDbTest.java
index 492baf1..bb285f2 100644
--- a/osmosis-dataset/src/test/java/org/openstreetmap/osmosis/dataset/v0_6/CustomDbTest.java
+++ b/osmosis-dataset/src/test/java/org/openstreetmap/osmosis/dataset/v0_6/CustomDbTest.java
@@ -36,7 +36,7 @@ public class CustomDbTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -47,7 +47,7 @@ public class CustomDbTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-customdb-0.6",
 				"directory=" + dataDir,
diff --git a/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/common/Configuration.java b/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/common/Configuration.java
index 22df315..4531f1d 100644
--- a/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/common/Configuration.java
+++ b/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/common/Configuration.java
@@ -5,8 +5,6 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.DatabaseLoginCredentials;
@@ -21,8 +19,6 @@ import org.openstreetmap.osmosis.core.database.DatabaseType;
  */
 public class Configuration {
 
-	private static final Logger LOG = Logger.getLogger(Configuration.class.getName());
-
 	private static final String KEY_HOST = "host";
 	private static final String KEY_DATABASE = "database";
 	private static final String KEY_USER = "user";
@@ -51,26 +47,13 @@ public class Configuration {
 
 
 	private Properties loadProperties(File configFile) {
-		FileInputStream fileInputStream = null;
-
 		properties = new Properties();
 
-		try {
-			fileInputStream = new FileInputStream(configFile);
-
+		try (FileInputStream fileInputStream = new FileInputStream(configFile)) {
 			properties.load(fileInputStream);
 
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to load properties from config file " + configFile);
-		} finally {
-			if (fileInputStream != null) {
-				try {
-					fileInputStream.close();
-				} catch (IOException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close file input stream.", e);
-				}
-			}
 		}
 
 		return properties;
diff --git a/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/DatabaseTimeLoader.java b/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/DatabaseTimeLoader.java
index d61674f..1ba460d 100644
--- a/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/DatabaseTimeLoader.java
+++ b/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/DatabaseTimeLoader.java
@@ -4,8 +4,6 @@ package org.openstreetmap.osmosis.extract.apidb.v0_6;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Date;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.apidb.common.DatabaseContext;
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
@@ -20,10 +18,6 @@ import org.openstreetmap.osmosis.core.database.DatabaseLoginCredentials;
  * @author Brett Henderson
  */
 public class DatabaseTimeLoader {
-	
-	private static final Logger LOG = Logger.getLogger(DatabaseTimeLoader.class.getName());
-	
-	
 	private DatabaseLoginCredentials loginCredentials;
 	
 	
@@ -38,30 +32,15 @@ public class DatabaseTimeLoader {
 	
 	
 	private Date readTimeField(ResultSet timeSet) {
-		ResultSet rs = timeSet;
-		try {
+		try (ResultSet rs = timeSet) {
 			Date dbTime;
-			Date result;
 			timeSet.next();
 			
 			dbTime = timeSet.getTimestamp("SystemTime");
-			result = new Date(dbTime.getTime());
-			
-			rs.close();
-			rs = null;
-			
-			return result;
+			return new Date(dbTime.getTime());
 
 		} catch (SQLException e) {
 			throw new OsmosisRuntimeException("Unable to read the time from the database server.", e);
-		} finally {
-			if (rs != null) {
-				try {
-					rs.close();
-				} catch (SQLException e) {
-					LOG.log(Level.WARNING, "Unable to close result set.", e);
-				}
-			}
 		}
 	}
 	
@@ -72,9 +51,7 @@ public class DatabaseTimeLoader {
 	 * @return The current system time.
 	 */
 	public Date getDatabaseTime() {
-		DatabaseContext dbCtx = new DatabaseContext(loginCredentials);
-		
-		try {
+		try (DatabaseContext dbCtx = new DatabaseContext(loginCredentials)) {
 			ResultSet rs;
 			Date result;
 			
@@ -83,8 +60,6 @@ public class DatabaseTimeLoader {
 			
 			return result;
 			
-		} finally {
-			dbCtx.release();
 		}
 	}
 }
diff --git a/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/OsmosisExtractApiDb.java b/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/OsmosisExtractApiDb.java
index 032902c..aafedcc 100644
--- a/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/OsmosisExtractApiDb.java
+++ b/osmosis-extract/src/main/java/org/openstreetmap/osmosis/extract/apidb/v0_6/OsmosisExtractApiDb.java
@@ -61,7 +61,7 @@ public class OsmosisExtractApiDb {
 			success = true;
 
 		} finally {
-			fileLock.release();
+			fileLock.close();
 		}
 
 		// Indicate success or otherwise.
diff --git a/osmosis-extract/src/test/resources/data/template/v0_6/apidb-authfile.txt b/osmosis-extract/src/test/resources/data/template/v0_6/apidb-authfile.txt
index cfd0584..28ab556 100644
--- a/osmosis-extract/src/test/resources/data/template/v0_6/apidb-authfile.txt
+++ b/osmosis-extract/src/test/resources/data/template/v0_6/apidb-authfile.txt
@@ -1,4 +1,4 @@
-host=localhost
+host=db
 database=api06_test
 user=osm
 password=password
diff --git a/osmosis-hstore-jdbc/src/main/java/org/openstreetmap/osmosis/hstore/PGHStore.java b/osmosis-hstore-jdbc/src/main/java/org/openstreetmap/osmosis/hstore/PGHStore.java
index 5e9c5a8..761a343 100644
--- a/osmosis-hstore-jdbc/src/main/java/org/openstreetmap/osmosis/hstore/PGHStore.java
+++ b/osmosis-hstore-jdbc/src/main/java/org/openstreetmap/osmosis/hstore/PGHStore.java
@@ -94,7 +94,7 @@ public class PGHStore extends PGobject implements Serializable, Cloneable, Map<S
      */
     public String getValue()
     {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder builder = new StringBuilder();
         Iterator<String> i = _map.keySet().iterator();
         boolean first = true;
         while (i.hasNext()) {
@@ -104,18 +104,18 @@ public class PGHStore extends PGobject implements Serializable, Cloneable, Map<S
             if (first) {
                 first = false;
             } else {
-                buf.append(',');
+                builder.append(',');
             }
 
-            writeValue(buf, key);
-            buf.append("=>");
-            writeValue(buf, value);
+            writeValue(builder, key);
+            builder.append("=>");
+            writeValue(builder, value);
         }
 
-        return buf.toString();
+        return builder.toString();
     }
 
-    private static void writeValue(StringBuffer buf, Object o) {
+    private static void writeValue(StringBuilder buf, Object o) {
         if (o == null) {
             buf.append("NULL");
             return;
@@ -159,7 +159,7 @@ public class PGHStore extends PGobject implements Serializable, Cloneable, Map<S
     private static class Parser {
         private String value;
         private int ptr;
-        private StringBuffer cur;
+        private StringBuilder cur;
         private boolean escaped;
 
         private List<String> keys;
@@ -199,7 +199,7 @@ public class PGHStore extends PGobject implements Serializable, Cloneable, Map<S
         private boolean getValue(boolean ignoreEqual) throws SQLException {
             int state = GV_WAITVAL;
 
-            cur = new StringBuffer();
+            cur = new StringBuilder();
             escaped = false;
 
             while (true) {
diff --git a/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Fileformat.java b/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Fileformat.java
index 1e26d53..eb55c9b 100644
--- a/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Fileformat.java
+++ b/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Fileformat.java
@@ -13,334 +13,344 @@ public final class Fileformat {
       com.google.protobuf.MessageLiteOrBuilder {
 
     /**
-     * <code>optional bytes raw = 1;</code>
-     *
      * <pre>
      * No compression
      * </pre>
+     *
+     * <code>optional bytes raw = 1;</code>
      */
     boolean hasRaw();
     /**
-     * <code>optional bytes raw = 1;</code>
-     *
      * <pre>
      * No compression
      * </pre>
+     *
+     * <code>optional bytes raw = 1;</code>
      */
     com.google.protobuf.ByteString getRaw();
 
     /**
-     * <code>optional int32 raw_size = 2;</code>
-     *
      * <pre>
      * When compressed, the uncompressed size
      * </pre>
+     *
+     * <code>optional int32 raw_size = 2;</code>
      */
     boolean hasRawSize();
     /**
-     * <code>optional int32 raw_size = 2;</code>
-     *
      * <pre>
      * When compressed, the uncompressed size
      * </pre>
+     *
+     * <code>optional int32 raw_size = 2;</code>
      */
     int getRawSize();
 
     /**
-     * <code>optional bytes zlib_data = 3;</code>
-     *
      * <pre>
      * Possible compressed versions of the data.
      * </pre>
+     *
+     * <code>optional bytes zlib_data = 3;</code>
      */
     boolean hasZlibData();
     /**
-     * <code>optional bytes zlib_data = 3;</code>
-     *
      * <pre>
      * Possible compressed versions of the data.
      * </pre>
+     *
+     * <code>optional bytes zlib_data = 3;</code>
      */
     com.google.protobuf.ByteString getZlibData();
 
     /**
-     * <code>optional bytes lzma_data = 4;</code>
-     *
      * <pre>
      * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
      * </pre>
+     *
+     * <code>optional bytes lzma_data = 4;</code>
      */
     boolean hasLzmaData();
     /**
-     * <code>optional bytes lzma_data = 4;</code>
-     *
      * <pre>
      * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
      * </pre>
+     *
+     * <code>optional bytes lzma_data = 4;</code>
      */
     com.google.protobuf.ByteString getLzmaData();
 
     /**
-     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-     *
      * <pre>
      * Formerly used for bzip2 compressed data. Depreciated in 2010.
      * </pre>
+     *
+     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
      */
     @java.lang.Deprecated boolean hasOBSOLETEBzip2Data();
     /**
-     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-     *
      * <pre>
      * Formerly used for bzip2 compressed data. Depreciated in 2010.
      * </pre>
+     *
+     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
      */
     @java.lang.Deprecated com.google.protobuf.ByteString getOBSOLETEBzip2Data();
   }
   /**
    * Protobuf type {@code OSMPBF.Blob}
    */
-  public static final class Blob extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class Blob extends
+      com.google.protobuf.GeneratedMessageLite<
+          Blob, Blob.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.Blob)
       BlobOrBuilder {
-    // Use Blob.newBuilder() to construct.
-    private Blob(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private Blob(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final Blob defaultInstance;
-    public static Blob getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public Blob getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private Blob(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 10: {
-              bitField0_ |= 0x00000001;
-              raw_ = input.readBytes();
-              break;
-            }
-            case 16: {
-              bitField0_ |= 0x00000002;
-              rawSize_ = input.readInt32();
-              break;
-            }
-            case 26: {
-              bitField0_ |= 0x00000004;
-              zlibData_ = input.readBytes();
-              break;
-            }
-            case 34: {
-              bitField0_ |= 0x00000008;
-              lzmaData_ = input.readBytes();
-              break;
-            }
-            case 42: {
-              bitField0_ |= 0x00000010;
-              oBSOLETEBzip2Data_ = input.readBytes();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<Blob> PARSER =
-        new com.google.protobuf.AbstractParser<Blob>() {
-      public Blob parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new Blob(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<Blob> getParserForType() {
-      return PARSER;
+    private Blob() {
+      raw_ = com.google.protobuf.ByteString.EMPTY;
+      zlibData_ = com.google.protobuf.ByteString.EMPTY;
+      lzmaData_ = com.google.protobuf.ByteString.EMPTY;
+      oBSOLETEBzip2Data_ = com.google.protobuf.ByteString.EMPTY;
     }
-
     private int bitField0_;
     public static final int RAW_FIELD_NUMBER = 1;
     private com.google.protobuf.ByteString raw_;
     /**
-     * <code>optional bytes raw = 1;</code>
-     *
      * <pre>
      * No compression
      * </pre>
+     *
+     * <code>optional bytes raw = 1;</code>
      */
     public boolean hasRaw() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
-     * <code>optional bytes raw = 1;</code>
-     *
      * <pre>
      * No compression
      * </pre>
+     *
+     * <code>optional bytes raw = 1;</code>
      */
     public com.google.protobuf.ByteString getRaw() {
       return raw_;
     }
+    /**
+     * <pre>
+     * No compression
+     * </pre>
+     *
+     * <code>optional bytes raw = 1;</code>
+     */
+    private void setRaw(com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000001;
+      raw_ = value;
+    }
+    /**
+     * <pre>
+     * No compression
+     * </pre>
+     *
+     * <code>optional bytes raw = 1;</code>
+     */
+    private void clearRaw() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      raw_ = getDefaultInstance().getRaw();
+    }
 
     public static final int RAW_SIZE_FIELD_NUMBER = 2;
     private int rawSize_;
     /**
-     * <code>optional int32 raw_size = 2;</code>
-     *
      * <pre>
      * When compressed, the uncompressed size
      * </pre>
+     *
+     * <code>optional int32 raw_size = 2;</code>
      */
     public boolean hasRawSize() {
       return ((bitField0_ & 0x00000002) == 0x00000002);
     }
     /**
-     * <code>optional int32 raw_size = 2;</code>
-     *
      * <pre>
      * When compressed, the uncompressed size
      * </pre>
+     *
+     * <code>optional int32 raw_size = 2;</code>
      */
     public int getRawSize() {
       return rawSize_;
     }
+    /**
+     * <pre>
+     * When compressed, the uncompressed size
+     * </pre>
+     *
+     * <code>optional int32 raw_size = 2;</code>
+     */
+    private void setRawSize(int value) {
+      bitField0_ |= 0x00000002;
+      rawSize_ = value;
+    }
+    /**
+     * <pre>
+     * When compressed, the uncompressed size
+     * </pre>
+     *
+     * <code>optional int32 raw_size = 2;</code>
+     */
+    private void clearRawSize() {
+      bitField0_ = (bitField0_ & ~0x00000002);
+      rawSize_ = 0;
+    }
 
     public static final int ZLIB_DATA_FIELD_NUMBER = 3;
     private com.google.protobuf.ByteString zlibData_;
     /**
-     * <code>optional bytes zlib_data = 3;</code>
-     *
      * <pre>
      * Possible compressed versions of the data.
      * </pre>
+     *
+     * <code>optional bytes zlib_data = 3;</code>
      */
     public boolean hasZlibData() {
       return ((bitField0_ & 0x00000004) == 0x00000004);
     }
     /**
-     * <code>optional bytes zlib_data = 3;</code>
-     *
      * <pre>
      * Possible compressed versions of the data.
      * </pre>
+     *
+     * <code>optional bytes zlib_data = 3;</code>
      */
     public com.google.protobuf.ByteString getZlibData() {
       return zlibData_;
     }
+    /**
+     * <pre>
+     * Possible compressed versions of the data.
+     * </pre>
+     *
+     * <code>optional bytes zlib_data = 3;</code>
+     */
+    private void setZlibData(com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000004;
+      zlibData_ = value;
+    }
+    /**
+     * <pre>
+     * Possible compressed versions of the data.
+     * </pre>
+     *
+     * <code>optional bytes zlib_data = 3;</code>
+     */
+    private void clearZlibData() {
+      bitField0_ = (bitField0_ & ~0x00000004);
+      zlibData_ = getDefaultInstance().getZlibData();
+    }
 
     public static final int LZMA_DATA_FIELD_NUMBER = 4;
     private com.google.protobuf.ByteString lzmaData_;
     /**
-     * <code>optional bytes lzma_data = 4;</code>
-     *
      * <pre>
      * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
      * </pre>
+     *
+     * <code>optional bytes lzma_data = 4;</code>
      */
     public boolean hasLzmaData() {
       return ((bitField0_ & 0x00000008) == 0x00000008);
     }
     /**
-     * <code>optional bytes lzma_data = 4;</code>
-     *
      * <pre>
      * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
      * </pre>
+     *
+     * <code>optional bytes lzma_data = 4;</code>
      */
     public com.google.protobuf.ByteString getLzmaData() {
       return lzmaData_;
     }
+    /**
+     * <pre>
+     * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
+     * </pre>
+     *
+     * <code>optional bytes lzma_data = 4;</code>
+     */
+    private void setLzmaData(com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000008;
+      lzmaData_ = value;
+    }
+    /**
+     * <pre>
+     * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
+     * </pre>
+     *
+     * <code>optional bytes lzma_data = 4;</code>
+     */
+    private void clearLzmaData() {
+      bitField0_ = (bitField0_ & ~0x00000008);
+      lzmaData_ = getDefaultInstance().getLzmaData();
+    }
 
     public static final int OBSOLETE_BZIP2_DATA_FIELD_NUMBER = 5;
     private com.google.protobuf.ByteString oBSOLETEBzip2Data_;
     /**
-     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-     *
      * <pre>
      * Formerly used for bzip2 compressed data. Depreciated in 2010.
      * </pre>
+     *
+     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
      */
     @java.lang.Deprecated public boolean hasOBSOLETEBzip2Data() {
       return ((bitField0_ & 0x00000010) == 0x00000010);
     }
     /**
-     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-     *
      * <pre>
      * Formerly used for bzip2 compressed data. Depreciated in 2010.
      * </pre>
+     *
+     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
      */
     @java.lang.Deprecated public com.google.protobuf.ByteString getOBSOLETEBzip2Data() {
       return oBSOLETEBzip2Data_;
     }
-
-    private void initFields() {
-      raw_ = com.google.protobuf.ByteString.EMPTY;
-      rawSize_ = 0;
-      zlibData_ = com.google.protobuf.ByteString.EMPTY;
-      lzmaData_ = com.google.protobuf.ByteString.EMPTY;
-      oBSOLETEBzip2Data_ = com.google.protobuf.ByteString.EMPTY;
+    /**
+     * <pre>
+     * Formerly used for bzip2 compressed data. Depreciated in 2010.
+     * </pre>
+     *
+     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
+     */
+    private void setOBSOLETEBzip2Data(com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000010;
+      oBSOLETEBzip2Data_ = value;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <pre>
+     * Formerly used for bzip2 compressed data. Depreciated in 2010.
+     * </pre>
+     *
+     * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
+     */
+    private void clearOBSOLETEBzip2Data() {
+      bitField0_ = (bitField0_ & ~0x00000010);
+      oBSOLETEBzip2Data_ = getDefaultInstance().getOBSOLETEBzip2Data();
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         output.writeBytes(1, raw_);
       }
@@ -356,10 +366,9 @@ public final class Fileformat {
       if (((bitField0_ & 0x00000010) == 0x00000010)) {
         output.writeBytes(5, oBSOLETEBzip2Data_);
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -385,463 +394,448 @@ public final class Fileformat {
         size += com.google.protobuf.CodedOutputStream
           .computeBytesSize(5, oBSOLETEBzip2Data_);
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Fileformat.Blob prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.Blob}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Fileformat.Blob, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Fileformat.Blob, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.Blob)
         org.openstreetmap.osmosis.osmbinary.Fileformat.BlobOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Fileformat.Blob.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        raw_ = com.google.protobuf.ByteString.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        rawSize_ = 0;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        zlibData_ = com.google.protobuf.ByteString.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000004);
-        lzmaData_ = com.google.protobuf.ByteString.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000008);
-        oBSOLETEBzip2Data_ = com.google.protobuf.ByteString.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000010);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Fileformat.Blob getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Fileformat.Blob.getDefaultInstance();
+        super(DEFAULT_INSTANCE);
       }
 
-      public org.openstreetmap.osmosis.osmbinary.Fileformat.Blob build() {
-        org.openstreetmap.osmosis.osmbinary.Fileformat.Blob result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
 
-      public org.openstreetmap.osmosis.osmbinary.Fileformat.Blob buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Fileformat.Blob result = new org.openstreetmap.osmosis.osmbinary.Fileformat.Blob(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.raw_ = raw_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.rawSize_ = rawSize_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
-          to_bitField0_ |= 0x00000004;
-        }
-        result.zlibData_ = zlibData_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000008;
-        }
-        result.lzmaData_ = lzmaData_;
-        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
-          to_bitField0_ |= 0x00000010;
-        }
-        result.oBSOLETEBzip2Data_ = oBSOLETEBzip2Data_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Fileformat.Blob other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Fileformat.Blob.getDefaultInstance()) return this;
-        if (other.hasRaw()) {
-          setRaw(other.getRaw());
-        }
-        if (other.hasRawSize()) {
-          setRawSize(other.getRawSize());
-        }
-        if (other.hasZlibData()) {
-          setZlibData(other.getZlibData());
-        }
-        if (other.hasLzmaData()) {
-          setLzmaData(other.getLzmaData());
-        }
-        if (other.hasOBSOLETEBzip2Data()) {
-          setOBSOLETEBzip2Data(other.getOBSOLETEBzip2Data());
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Fileformat.Blob parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Fileformat.Blob) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
-
-      private com.google.protobuf.ByteString raw_ = com.google.protobuf.ByteString.EMPTY;
       /**
-       * <code>optional bytes raw = 1;</code>
-       *
        * <pre>
        * No compression
        * </pre>
+       *
+       * <code>optional bytes raw = 1;</code>
        */
       public boolean hasRaw() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasRaw();
       }
       /**
-       * <code>optional bytes raw = 1;</code>
-       *
        * <pre>
        * No compression
        * </pre>
+       *
+       * <code>optional bytes raw = 1;</code>
        */
       public com.google.protobuf.ByteString getRaw() {
-        return raw_;
+        return instance.getRaw();
       }
       /**
-       * <code>optional bytes raw = 1;</code>
-       *
        * <pre>
        * No compression
        * </pre>
+       *
+       * <code>optional bytes raw = 1;</code>
        */
       public Builder setRaw(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000001;
-        raw_ = value;
-        
+        copyOnWrite();
+        instance.setRaw(value);
         return this;
       }
       /**
-       * <code>optional bytes raw = 1;</code>
-       *
        * <pre>
        * No compression
        * </pre>
+       *
+       * <code>optional bytes raw = 1;</code>
        */
       public Builder clearRaw() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        raw_ = getDefaultInstance().getRaw();
-        
+        copyOnWrite();
+        instance.clearRaw();
         return this;
       }
 
-      private int rawSize_ ;
       /**
-       * <code>optional int32 raw_size = 2;</code>
-       *
        * <pre>
        * When compressed, the uncompressed size
        * </pre>
+       *
+       * <code>optional int32 raw_size = 2;</code>
        */
       public boolean hasRawSize() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
+        return instance.hasRawSize();
       }
       /**
-       * <code>optional int32 raw_size = 2;</code>
-       *
        * <pre>
        * When compressed, the uncompressed size
        * </pre>
+       *
+       * <code>optional int32 raw_size = 2;</code>
        */
       public int getRawSize() {
-        return rawSize_;
+        return instance.getRawSize();
       }
       /**
-       * <code>optional int32 raw_size = 2;</code>
-       *
        * <pre>
        * When compressed, the uncompressed size
        * </pre>
+       *
+       * <code>optional int32 raw_size = 2;</code>
        */
       public Builder setRawSize(int value) {
-        bitField0_ |= 0x00000002;
-        rawSize_ = value;
-        
+        copyOnWrite();
+        instance.setRawSize(value);
         return this;
       }
       /**
-       * <code>optional int32 raw_size = 2;</code>
-       *
        * <pre>
        * When compressed, the uncompressed size
        * </pre>
+       *
+       * <code>optional int32 raw_size = 2;</code>
        */
       public Builder clearRawSize() {
-        bitField0_ = (bitField0_ & ~0x00000002);
-        rawSize_ = 0;
-        
+        copyOnWrite();
+        instance.clearRawSize();
         return this;
       }
 
-      private com.google.protobuf.ByteString zlibData_ = com.google.protobuf.ByteString.EMPTY;
       /**
-       * <code>optional bytes zlib_data = 3;</code>
-       *
        * <pre>
        * Possible compressed versions of the data.
        * </pre>
+       *
+       * <code>optional bytes zlib_data = 3;</code>
        */
       public boolean hasZlibData() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
+        return instance.hasZlibData();
       }
       /**
-       * <code>optional bytes zlib_data = 3;</code>
-       *
        * <pre>
        * Possible compressed versions of the data.
        * </pre>
+       *
+       * <code>optional bytes zlib_data = 3;</code>
        */
       public com.google.protobuf.ByteString getZlibData() {
-        return zlibData_;
+        return instance.getZlibData();
       }
       /**
-       * <code>optional bytes zlib_data = 3;</code>
-       *
        * <pre>
        * Possible compressed versions of the data.
        * </pre>
+       *
+       * <code>optional bytes zlib_data = 3;</code>
        */
       public Builder setZlibData(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000004;
-        zlibData_ = value;
-        
+        copyOnWrite();
+        instance.setZlibData(value);
         return this;
       }
       /**
-       * <code>optional bytes zlib_data = 3;</code>
-       *
        * <pre>
        * Possible compressed versions of the data.
        * </pre>
+       *
+       * <code>optional bytes zlib_data = 3;</code>
        */
       public Builder clearZlibData() {
-        bitField0_ = (bitField0_ & ~0x00000004);
-        zlibData_ = getDefaultInstance().getZlibData();
-        
+        copyOnWrite();
+        instance.clearZlibData();
         return this;
       }
 
-      private com.google.protobuf.ByteString lzmaData_ = com.google.protobuf.ByteString.EMPTY;
       /**
-       * <code>optional bytes lzma_data = 4;</code>
-       *
        * <pre>
        * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
        * </pre>
+       *
+       * <code>optional bytes lzma_data = 4;</code>
        */
       public boolean hasLzmaData() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasLzmaData();
       }
       /**
-       * <code>optional bytes lzma_data = 4;</code>
-       *
        * <pre>
        * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
        * </pre>
+       *
+       * <code>optional bytes lzma_data = 4;</code>
        */
       public com.google.protobuf.ByteString getLzmaData() {
-        return lzmaData_;
+        return instance.getLzmaData();
       }
       /**
-       * <code>optional bytes lzma_data = 4;</code>
-       *
        * <pre>
        * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
        * </pre>
+       *
+       * <code>optional bytes lzma_data = 4;</code>
        */
       public Builder setLzmaData(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000008;
-        lzmaData_ = value;
-        
+        copyOnWrite();
+        instance.setLzmaData(value);
         return this;
       }
       /**
-       * <code>optional bytes lzma_data = 4;</code>
-       *
        * <pre>
        * PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
        * </pre>
+       *
+       * <code>optional bytes lzma_data = 4;</code>
        */
       public Builder clearLzmaData() {
-        bitField0_ = (bitField0_ & ~0x00000008);
-        lzmaData_ = getDefaultInstance().getLzmaData();
-        
+        copyOnWrite();
+        instance.clearLzmaData();
         return this;
       }
 
-      private com.google.protobuf.ByteString oBSOLETEBzip2Data_ = com.google.protobuf.ByteString.EMPTY;
       /**
-       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-       *
        * <pre>
        * Formerly used for bzip2 compressed data. Depreciated in 2010.
        * </pre>
+       *
+       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
        */
       @java.lang.Deprecated public boolean hasOBSOLETEBzip2Data() {
-        return ((bitField0_ & 0x00000010) == 0x00000010);
+        return instance.hasOBSOLETEBzip2Data();
       }
       /**
-       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-       *
        * <pre>
        * Formerly used for bzip2 compressed data. Depreciated in 2010.
        * </pre>
+       *
+       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
        */
       @java.lang.Deprecated public com.google.protobuf.ByteString getOBSOLETEBzip2Data() {
-        return oBSOLETEBzip2Data_;
+        return instance.getOBSOLETEBzip2Data();
       }
       /**
-       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-       *
        * <pre>
        * Formerly used for bzip2 compressed data. Depreciated in 2010.
        * </pre>
+       *
+       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
        */
       @java.lang.Deprecated public Builder setOBSOLETEBzip2Data(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000010;
-        oBSOLETEBzip2Data_ = value;
-        
+        copyOnWrite();
+        instance.setOBSOLETEBzip2Data(value);
         return this;
       }
       /**
-       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
-       *
        * <pre>
        * Formerly used for bzip2 compressed data. Depreciated in 2010.
        * </pre>
+       *
+       * <code>optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];</code>
        */
       @java.lang.Deprecated public Builder clearOBSOLETEBzip2Data() {
-        bitField0_ = (bitField0_ & ~0x00000010);
-        oBSOLETEBzip2Data_ = getDefaultInstance().getOBSOLETEBzip2Data();
-        
+        copyOnWrite();
+        instance.clearOBSOLETEBzip2Data();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.Blob)
     }
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Fileformat.Blob();
+        }
+        case IS_INITIALIZED: {
+          return DEFAULT_INSTANCE;
+        }
+        case MAKE_IMMUTABLE: {
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Fileformat.Blob other = (org.openstreetmap.osmosis.osmbinary.Fileformat.Blob) arg1;
+          raw_ = visitor.visitByteString(
+              hasRaw(), raw_,
+              other.hasRaw(), other.raw_);
+          rawSize_ = visitor.visitInt(
+              hasRawSize(), rawSize_,
+              other.hasRawSize(), other.rawSize_);
+          zlibData_ = visitor.visitByteString(
+              hasZlibData(), zlibData_,
+              other.hasZlibData(), other.zlibData_);
+          lzmaData_ = visitor.visitByteString(
+              hasLzmaData(), lzmaData_,
+              other.hasLzmaData(), other.lzmaData_);
+          oBSOLETEBzip2Data_ = visitor.visitByteString(
+              hasOBSOLETEBzip2Data(), oBSOLETEBzip2Data_,
+              other.hasOBSOLETEBzip2Data(), other.oBSOLETEBzip2Data_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 10: {
+                  bitField0_ |= 0x00000001;
+                  raw_ = input.readBytes();
+                  break;
+                }
+                case 16: {
+                  bitField0_ |= 0x00000002;
+                  rawSize_ = input.readInt32();
+                  break;
+                }
+                case 26: {
+                  bitField0_ |= 0x00000004;
+                  zlibData_ = input.readBytes();
+                  break;
+                }
+                case 34: {
+                  bitField0_ |= 0x00000008;
+                  lzmaData_ = input.readBytes();
+                  break;
+                }
+                case 42: {
+                  bitField0_ |= 0x00000010;
+                  oBSOLETEBzip2Data_ = input.readBytes();
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Fileformat.Blob.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
+
 
+    // @@protoc_insertion_point(class_scope:OSMPBF.Blob)
+    private static final org.openstreetmap.osmosis.osmbinary.Fileformat.Blob DEFAULT_INSTANCE;
     static {
-      defaultInstance = new Blob(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new Blob();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.Blob)
+    public static org.openstreetmap.osmosis.osmbinary.Fileformat.Blob getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<Blob> PARSER;
+
+    public static com.google.protobuf.Parser<Blob> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface BlobHeaderOrBuilder extends
@@ -883,105 +877,18 @@ public final class Fileformat {
   /**
    * Protobuf type {@code OSMPBF.BlobHeader}
    */
-  public static final class BlobHeader extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class BlobHeader extends
+      com.google.protobuf.GeneratedMessageLite<
+          BlobHeader, BlobHeader.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.BlobHeader)
       BlobHeaderOrBuilder {
-    // Use BlobHeader.newBuilder() to construct.
-    private BlobHeader(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private BlobHeader(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final BlobHeader defaultInstance;
-    public static BlobHeader getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public BlobHeader getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private BlobHeader(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 10: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000001;
-              type_ = bs;
-              break;
-            }
-            case 18: {
-              bitField0_ |= 0x00000002;
-              indexdata_ = input.readBytes();
-              break;
-            }
-            case 24: {
-              bitField0_ |= 0x00000004;
-              datasize_ = input.readInt32();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<BlobHeader> PARSER =
-        new com.google.protobuf.AbstractParser<BlobHeader>() {
-      public BlobHeader parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new BlobHeader(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<BlobHeader> getParserForType() {
-      return PARSER;
+    private BlobHeader() {
+      type_ = "";
+      indexdata_ = com.google.protobuf.ByteString.EMPTY;
     }
-
     private int bitField0_;
     public static final int TYPE_FIELD_NUMBER = 1;
-    private java.lang.Object type_;
+    private java.lang.String type_;
     /**
      * <code>required string type = 1;</code>
      */
@@ -992,34 +899,43 @@ public final class Fileformat {
      * <code>required string type = 1;</code>
      */
     public java.lang.String getType() {
-      java.lang.Object ref = type_;
-      if (ref instanceof java.lang.String) {
-        return (java.lang.String) ref;
-      } else {
-        com.google.protobuf.ByteString bs = 
-            (com.google.protobuf.ByteString) ref;
-        java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          type_ = s;
-        }
-        return s;
-      }
+      return type_;
     }
     /**
      * <code>required string type = 1;</code>
      */
     public com.google.protobuf.ByteString
         getTypeBytes() {
-      java.lang.Object ref = type_;
-      if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
-            com.google.protobuf.ByteString.copyFromUtf8(
-                (java.lang.String) ref);
-        type_ = b;
-        return b;
-      } else {
-        return (com.google.protobuf.ByteString) ref;
-      }
+      return com.google.protobuf.ByteString.copyFromUtf8(type_);
+    }
+    /**
+     * <code>required string type = 1;</code>
+     */
+    private void setType(
+        java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000001;
+      type_ = value;
+    }
+    /**
+     * <code>required string type = 1;</code>
+     */
+    private void clearType() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      type_ = getDefaultInstance().getType();
+    }
+    /**
+     * <code>required string type = 1;</code>
+     */
+    private void setTypeBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000001;
+      type_ = value.toStringUtf8();
     }
 
     public static final int INDEXDATA_FIELD_NUMBER = 2;
@@ -1036,6 +952,23 @@ public final class Fileformat {
     public com.google.protobuf.ByteString getIndexdata() {
       return indexdata_;
     }
+    /**
+     * <code>optional bytes indexdata = 2;</code>
+     */
+    private void setIndexdata(com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000002;
+      indexdata_ = value;
+    }
+    /**
+     * <code>optional bytes indexdata = 2;</code>
+     */
+    private void clearIndexdata() {
+      bitField0_ = (bitField0_ & ~0x00000002);
+      indexdata_ = getDefaultInstance().getIndexdata();
+    }
 
     public static final int DATASIZE_FIELD_NUMBER = 3;
     private int datasize_;
@@ -1051,35 +984,25 @@ public final class Fileformat {
     public int getDatasize() {
       return datasize_;
     }
-
-    private void initFields() {
-      type_ = "";
-      indexdata_ = com.google.protobuf.ByteString.EMPTY;
-      datasize_ = 0;
+    /**
+     * <code>required int32 datasize = 3;</code>
+     */
+    private void setDatasize(int value) {
+      bitField0_ |= 0x00000004;
+      datasize_ = value;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      if (!hasType()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      if (!hasDatasize()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <code>required int32 datasize = 3;</code>
+     */
+    private void clearDatasize() {
+      bitField0_ = (bitField0_ & ~0x00000004);
+      datasize_ = 0;
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeBytes(1, getTypeBytes());
+        output.writeString(1, getType());
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         output.writeBytes(2, indexdata_);
@@ -1087,10 +1010,9 @@ public final class Fileformat {
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         output.writeInt32(3, datasize_);
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -1098,7 +1020,7 @@ public final class Fileformat {
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(1, getTypeBytes());
+          .computeStringSize(1, getType());
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
@@ -1108,254 +1030,127 @@ public final class Fileformat {
         size += com.google.protobuf.CodedOutputStream
           .computeInt32Size(3, datasize_);
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.BlobHeader}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.BlobHeader)
         org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeaderOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder clear() {
-        super.clear();
-        type_ = "";
-        bitField0_ = (bitField0_ & ~0x00000001);
-        indexdata_ = com.google.protobuf.ByteString.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        datasize_ = 0;
-        bitField0_ = (bitField0_ & ~0x00000004);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
 
-      public org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader build() {
-        org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader result = new org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.type_ = type_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.indexdata_ = indexdata_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
-          to_bitField0_ |= 0x00000004;
-        }
-        result.datasize_ = datasize_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader.getDefaultInstance()) return this;
-        if (other.hasType()) {
-          bitField0_ |= 0x00000001;
-          type_ = other.type_;
-          
-        }
-        if (other.hasIndexdata()) {
-          setIndexdata(other.getIndexdata());
-        }
-        if (other.hasDatasize()) {
-          setDatasize(other.getDatasize());
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        if (!hasType()) {
-          
-          return false;
-        }
-        if (!hasDatasize()) {
-          
-          return false;
-        }
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
-
-      private java.lang.Object type_ = "";
       /**
        * <code>required string type = 1;</code>
        */
       public boolean hasType() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasType();
       }
       /**
        * <code>required string type = 1;</code>
        */
       public java.lang.String getType() {
-        java.lang.Object ref = type_;
-        if (!(ref instanceof java.lang.String)) {
-          com.google.protobuf.ByteString bs =
-              (com.google.protobuf.ByteString) ref;
-          java.lang.String s = bs.toStringUtf8();
-          if (bs.isValidUtf8()) {
-            type_ = s;
-          }
-          return s;
-        } else {
-          return (java.lang.String) ref;
-        }
+        return instance.getType();
       }
       /**
        * <code>required string type = 1;</code>
        */
       public com.google.protobuf.ByteString
           getTypeBytes() {
-        java.lang.Object ref = type_;
-        if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
-              com.google.protobuf.ByteString.copyFromUtf8(
-                  (java.lang.String) ref);
-          type_ = b;
-          return b;
-        } else {
-          return (com.google.protobuf.ByteString) ref;
-        }
+        return instance.getTypeBytes();
       }
       /**
        * <code>required string type = 1;</code>
        */
       public Builder setType(
           java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000001;
-        type_ = value;
-        
+        copyOnWrite();
+        instance.setType(value);
         return this;
       }
       /**
        * <code>required string type = 1;</code>
        */
       public Builder clearType() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        type_ = getDefaultInstance().getType();
-        
+        copyOnWrite();
+        instance.clearType();
         return this;
       }
       /**
@@ -1363,91 +1158,204 @@ public final class Fileformat {
        */
       public Builder setTypeBytes(
           com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000001;
-        type_ = value;
-        
+        copyOnWrite();
+        instance.setTypeBytes(value);
         return this;
       }
 
-      private com.google.protobuf.ByteString indexdata_ = com.google.protobuf.ByteString.EMPTY;
       /**
        * <code>optional bytes indexdata = 2;</code>
        */
       public boolean hasIndexdata() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
+        return instance.hasIndexdata();
       }
       /**
        * <code>optional bytes indexdata = 2;</code>
        */
       public com.google.protobuf.ByteString getIndexdata() {
-        return indexdata_;
+        return instance.getIndexdata();
       }
       /**
        * <code>optional bytes indexdata = 2;</code>
        */
       public Builder setIndexdata(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000002;
-        indexdata_ = value;
-        
+        copyOnWrite();
+        instance.setIndexdata(value);
         return this;
       }
       /**
        * <code>optional bytes indexdata = 2;</code>
        */
       public Builder clearIndexdata() {
-        bitField0_ = (bitField0_ & ~0x00000002);
-        indexdata_ = getDefaultInstance().getIndexdata();
-        
+        copyOnWrite();
+        instance.clearIndexdata();
         return this;
       }
 
-      private int datasize_ ;
       /**
        * <code>required int32 datasize = 3;</code>
        */
       public boolean hasDatasize() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
+        return instance.hasDatasize();
       }
       /**
        * <code>required int32 datasize = 3;</code>
        */
       public int getDatasize() {
-        return datasize_;
+        return instance.getDatasize();
       }
       /**
        * <code>required int32 datasize = 3;</code>
        */
       public Builder setDatasize(int value) {
-        bitField0_ |= 0x00000004;
-        datasize_ = value;
-        
+        copyOnWrite();
+        instance.setDatasize(value);
         return this;
       }
       /**
        * <code>required int32 datasize = 3;</code>
        */
       public Builder clearDatasize() {
-        bitField0_ = (bitField0_ & ~0x00000004);
-        datasize_ = 0;
-        
+        copyOnWrite();
+        instance.clearDatasize();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.BlobHeader)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (!hasType()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (!hasDatasize()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
 
-    static {
-      defaultInstance = new BlobHeader(true);
-      defaultInstance.initFields();
+        }
+        case MAKE_IMMUTABLE: {
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader other = (org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader) arg1;
+          type_ = visitor.visitString(
+              hasType(), type_,
+              other.hasType(), other.type_);
+          indexdata_ = visitor.visitByteString(
+              hasIndexdata(), indexdata_,
+              other.hasIndexdata(), other.indexdata_);
+          datasize_ = visitor.visitInt(
+              hasDatasize(), datasize_,
+              other.hasDatasize(), other.datasize_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 10: {
+                  String s = input.readString();
+                  bitField0_ |= 0x00000001;
+                  type_ = s;
+                  break;
+                }
+                case 18: {
+                  bitField0_ |= 0x00000002;
+                  indexdata_ = input.readBytes();
+                  break;
+                }
+                case 24: {
+                  bitField0_ |= 0x00000004;
+                  datasize_ = input.readInt32();
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
     }
 
+
     // @@protoc_insertion_point(class_scope:OSMPBF.BlobHeader)
+    private static final org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader DEFAULT_INSTANCE;
+    static {
+      DEFAULT_INSTANCE = new BlobHeader();
+      DEFAULT_INSTANCE.makeImmutable();
+    }
+
+    public static org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<BlobHeader> PARSER;
+
+    public static com.google.protobuf.Parser<BlobHeader> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
 
diff --git a/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Osmformat.java b/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Osmformat.java
index 1e09a06..0c90936 100644
--- a/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Osmformat.java
+++ b/osmosis-osm-binary/gen-src/main/java/org/openstreetmap/osmosis/osmbinary/Osmformat.java
@@ -22,36 +22,36 @@ public final class Osmformat {
     org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox getBbox();
 
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
-    com.google.protobuf.ProtocolStringList
+    java.util.List<String>
         getRequiredFeaturesList();
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
     int getRequiredFeaturesCount();
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
     java.lang.String getRequiredFeatures(int index);
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
     com.google.protobuf.ByteString
         getRequiredFeaturesBytes(int index);
@@ -59,7 +59,7 @@ public final class Osmformat {
     /**
      * <code>repeated string optional_features = 5;</code>
      */
-    com.google.protobuf.ProtocolStringList
+    java.util.List<String>
         getOptionalFeaturesList();
     /**
      * <code>repeated string optional_features = 5;</code>
@@ -90,91 +90,91 @@ public final class Osmformat {
         getWritingprogramBytes();
 
     /**
-     * <code>optional string source = 17;</code>
-     *
      * <pre>
      * From the bbox field.
      * </pre>
+     *
+     * <code>optional string source = 17;</code>
      */
     boolean hasSource();
     /**
-     * <code>optional string source = 17;</code>
-     *
      * <pre>
      * From the bbox field.
      * </pre>
+     *
+     * <code>optional string source = 17;</code>
      */
     java.lang.String getSource();
     /**
-     * <code>optional string source = 17;</code>
-     *
      * <pre>
      * From the bbox field.
      * </pre>
+     *
+     * <code>optional string source = 17;</code>
      */
     com.google.protobuf.ByteString
         getSourceBytes();
 
     /**
-     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-     *
      * <pre>
      * replication timestamp, expressed in seconds since the epoch, 
      * otherwise the same value as in the "timestamp=..." field
      * in the state.txt file used by Osmosis
      * </pre>
+     *
+     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
      */
     boolean hasOsmosisReplicationTimestamp();
     /**
-     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-     *
      * <pre>
      * replication timestamp, expressed in seconds since the epoch, 
      * otherwise the same value as in the "timestamp=..." field
      * in the state.txt file used by Osmosis
      * </pre>
+     *
+     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
      */
     long getOsmosisReplicationTimestamp();
 
     /**
-     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-     *
      * <pre>
      * replication sequence number (sequenceNumber in state.txt)
      * </pre>
+     *
+     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
      */
     boolean hasOsmosisReplicationSequenceNumber();
     /**
-     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-     *
      * <pre>
      * replication sequence number (sequenceNumber in state.txt)
      * </pre>
+     *
+     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
      */
     long getOsmosisReplicationSequenceNumber();
 
     /**
-     * <code>optional string osmosis_replication_base_url = 34;</code>
-     *
      * <pre>
      * replication base URL (from Osmosis' configuration.txt file)
      * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
      */
     boolean hasOsmosisReplicationBaseUrl();
     /**
-     * <code>optional string osmosis_replication_base_url = 34;</code>
-     *
      * <pre>
      * replication base URL (from Osmosis' configuration.txt file)
      * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
      */
     java.lang.String getOsmosisReplicationBaseUrl();
     /**
-     * <code>optional string osmosis_replication_base_url = 34;</code>
-     *
      * <pre>
      * replication base URL (from Osmosis' configuration.txt file)
      * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
      */
     com.google.protobuf.ByteString
         getOsmosisReplicationBaseUrlBytes();
@@ -182,151 +182,18 @@ public final class Osmformat {
   /**
    * Protobuf type {@code OSMPBF.HeaderBlock}
    */
-  public static final class HeaderBlock extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class HeaderBlock extends
+      com.google.protobuf.GeneratedMessageLite<
+          HeaderBlock, HeaderBlock.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.HeaderBlock)
       HeaderBlockOrBuilder {
-    // Use HeaderBlock.newBuilder() to construct.
-    private HeaderBlock(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private HeaderBlock(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final HeaderBlock defaultInstance;
-    public static HeaderBlock getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public HeaderBlock getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private HeaderBlock(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 10: {
-              org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000001) == 0x00000001)) {
-                subBuilder = bbox_.toBuilder();
-              }
-              bbox_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.PARSER, extensionRegistry);
-              if (subBuilder != null) {
-                subBuilder.mergeFrom(bbox_);
-                bbox_ = subBuilder.buildPartial();
-              }
-              bitField0_ |= 0x00000001;
-              break;
-            }
-            case 34: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                requiredFeatures_ = new com.google.protobuf.LazyStringArrayList();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              requiredFeatures_.add(bs);
-              break;
-            }
-            case 42: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                optionalFeatures_ = new com.google.protobuf.LazyStringArrayList();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              optionalFeatures_.add(bs);
-              break;
-            }
-            case 130: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000002;
-              writingprogram_ = bs;
-              break;
-            }
-            case 138: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000004;
-              source_ = bs;
-              break;
-            }
-            case 256: {
-              bitField0_ |= 0x00000008;
-              osmosisReplicationTimestamp_ = input.readInt64();
-              break;
-            }
-            case 264: {
-              bitField0_ |= 0x00000010;
-              osmosisReplicationSequenceNumber_ = input.readInt64();
-              break;
-            }
-            case 274: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000020;
-              osmosisReplicationBaseUrl_ = bs;
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-          requiredFeatures_ = requiredFeatures_.getUnmodifiableView();
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          optionalFeatures_ = optionalFeatures_.getUnmodifiableView();
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<HeaderBlock> PARSER =
-        new com.google.protobuf.AbstractParser<HeaderBlock>() {
-      public HeaderBlock parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new HeaderBlock(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<HeaderBlock> getParserForType() {
-      return PARSER;
+    private HeaderBlock() {
+      requiredFeatures_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
+      optionalFeatures_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
+      writingprogram_ = "";
+      source_ = "";
+      osmosisReplicationBaseUrl_ = "";
     }
-
     private int bitField0_;
     public static final int BBOX_FIELD_NUMBER = 1;
     private org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox bbox_;
@@ -340,61 +207,171 @@ public final class Osmformat {
      * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
      */
     public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox getBbox() {
-      return bbox_;
+      return bbox_ == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance() : bbox_;
+    }
+    /**
+     * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
+     */
+    private void setBbox(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      bbox_ = value;
+      bitField0_ |= 0x00000001;
+      }
+    /**
+     * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
+     */
+    private void setBbox(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.Builder builderForValue) {
+      bbox_ = builderForValue.build();
+      bitField0_ |= 0x00000001;
+    }
+    /**
+     * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
+     */
+    private void mergeBbox(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox value) {
+      if (bbox_ != null &&
+          bbox_ != org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance()) {
+        bbox_ =
+          org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.newBuilder(bbox_).mergeFrom(value).buildPartial();
+      } else {
+        bbox_ = value;
+      }
+      bitField0_ |= 0x00000001;
+    }
+    /**
+     * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
+     */
+    private void clearBbox() {  bbox_ = null;
+      bitField0_ = (bitField0_ & ~0x00000001);
     }
 
     public static final int REQUIRED_FEATURES_FIELD_NUMBER = 4;
-    private com.google.protobuf.LazyStringList requiredFeatures_;
+    private com.google.protobuf.Internal.ProtobufList<String> requiredFeatures_;
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
-    public com.google.protobuf.ProtocolStringList
-        getRequiredFeaturesList() {
+    public java.util.List<String> getRequiredFeaturesList() {
       return requiredFeatures_;
     }
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
     public int getRequiredFeaturesCount() {
       return requiredFeatures_.size();
     }
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
     public java.lang.String getRequiredFeatures(int index) {
       return requiredFeatures_.get(index);
     }
     /**
-     * <code>repeated string required_features = 4;</code>
-     *
      * <pre>
      * Additional tags to aid in parsing this dataset 
      * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
      */
     public com.google.protobuf.ByteString
         getRequiredFeaturesBytes(int index) {
-      return requiredFeatures_.getByteString(index);
+      return com.google.protobuf.ByteString.copyFromUtf8(
+          requiredFeatures_.get(index));
+    }
+    private void ensureRequiredFeaturesIsMutable() {
+      if (!requiredFeatures_.isModifiable()) {
+        requiredFeatures_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(requiredFeatures_);
+       }
+    }
+    /**
+     * <pre>
+     * Additional tags to aid in parsing this dataset 
+     * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
+     */
+    private void setRequiredFeatures(
+        int index, java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureRequiredFeaturesIsMutable();
+      requiredFeatures_.set(index, value);
+    }
+    /**
+     * <pre>
+     * Additional tags to aid in parsing this dataset 
+     * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
+     */
+    private void addRequiredFeatures(
+        java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureRequiredFeaturesIsMutable();
+      requiredFeatures_.add(value);
+    }
+    /**
+     * <pre>
+     * Additional tags to aid in parsing this dataset 
+     * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
+     */
+    private void addAllRequiredFeatures(
+        java.lang.Iterable<java.lang.String> values) {
+      ensureRequiredFeaturesIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, requiredFeatures_);
+    }
+    /**
+     * <pre>
+     * Additional tags to aid in parsing this dataset 
+     * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
+     */
+    private void clearRequiredFeatures() {
+      requiredFeatures_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
+    }
+    /**
+     * <pre>
+     * Additional tags to aid in parsing this dataset 
+     * </pre>
+     *
+     * <code>repeated string required_features = 4;</code>
+     */
+    private void addRequiredFeaturesBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureRequiredFeaturesIsMutable();
+      requiredFeatures_.add(value.toStringUtf8());
     }
 
     public static final int OPTIONAL_FEATURES_FIELD_NUMBER = 5;
-    private com.google.protobuf.LazyStringList optionalFeatures_;
+    private com.google.protobuf.Internal.ProtobufList<String> optionalFeatures_;
     /**
      * <code>repeated string optional_features = 5;</code>
      */
-    public com.google.protobuf.ProtocolStringList
-        getOptionalFeaturesList() {
+    public java.util.List<String> getOptionalFeaturesList() {
       return optionalFeatures_;
     }
     /**
@@ -414,11 +391,66 @@ public final class Osmformat {
      */
     public com.google.protobuf.ByteString
         getOptionalFeaturesBytes(int index) {
-      return optionalFeatures_.getByteString(index);
+      return com.google.protobuf.ByteString.copyFromUtf8(
+          optionalFeatures_.get(index));
+    }
+    private void ensureOptionalFeaturesIsMutable() {
+      if (!optionalFeatures_.isModifiable()) {
+        optionalFeatures_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(optionalFeatures_);
+       }
+    }
+    /**
+     * <code>repeated string optional_features = 5;</code>
+     */
+    private void setOptionalFeatures(
+        int index, java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureOptionalFeaturesIsMutable();
+      optionalFeatures_.set(index, value);
+    }
+    /**
+     * <code>repeated string optional_features = 5;</code>
+     */
+    private void addOptionalFeatures(
+        java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureOptionalFeaturesIsMutable();
+      optionalFeatures_.add(value);
+    }
+    /**
+     * <code>repeated string optional_features = 5;</code>
+     */
+    private void addAllOptionalFeatures(
+        java.lang.Iterable<java.lang.String> values) {
+      ensureOptionalFeaturesIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, optionalFeatures_);
+    }
+    /**
+     * <code>repeated string optional_features = 5;</code>
+     */
+    private void clearOptionalFeatures() {
+      optionalFeatures_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
+    }
+    /**
+     * <code>repeated string optional_features = 5;</code>
+     */
+    private void addOptionalFeaturesBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureOptionalFeaturesIsMutable();
+      optionalFeatures_.add(value.toStringUtf8());
     }
 
     public static final int WRITINGPROGRAM_FIELD_NUMBER = 16;
-    private java.lang.Object writingprogram_;
+    private java.lang.String writingprogram_;
     /**
      * <code>optional string writingprogram = 16;</code>
      */
@@ -429,237 +461,309 @@ public final class Osmformat {
      * <code>optional string writingprogram = 16;</code>
      */
     public java.lang.String getWritingprogram() {
-      java.lang.Object ref = writingprogram_;
-      if (ref instanceof java.lang.String) {
-        return (java.lang.String) ref;
-      } else {
-        com.google.protobuf.ByteString bs = 
-            (com.google.protobuf.ByteString) ref;
-        java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          writingprogram_ = s;
-        }
-        return s;
-      }
+      return writingprogram_;
     }
     /**
      * <code>optional string writingprogram = 16;</code>
      */
     public com.google.protobuf.ByteString
         getWritingprogramBytes() {
-      java.lang.Object ref = writingprogram_;
-      if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
-            com.google.protobuf.ByteString.copyFromUtf8(
-                (java.lang.String) ref);
-        writingprogram_ = b;
-        return b;
-      } else {
-        return (com.google.protobuf.ByteString) ref;
-      }
+      return com.google.protobuf.ByteString.copyFromUtf8(writingprogram_);
+    }
+    /**
+     * <code>optional string writingprogram = 16;</code>
+     */
+    private void setWritingprogram(
+        java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000002;
+      writingprogram_ = value;
+    }
+    /**
+     * <code>optional string writingprogram = 16;</code>
+     */
+    private void clearWritingprogram() {
+      bitField0_ = (bitField0_ & ~0x00000002);
+      writingprogram_ = getDefaultInstance().getWritingprogram();
+    }
+    /**
+     * <code>optional string writingprogram = 16;</code>
+     */
+    private void setWritingprogramBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000002;
+      writingprogram_ = value.toStringUtf8();
     }
 
     public static final int SOURCE_FIELD_NUMBER = 17;
-    private java.lang.Object source_;
+    private java.lang.String source_;
     /**
-     * <code>optional string source = 17;</code>
-     *
      * <pre>
      * From the bbox field.
      * </pre>
+     *
+     * <code>optional string source = 17;</code>
      */
     public boolean hasSource() {
       return ((bitField0_ & 0x00000004) == 0x00000004);
     }
     /**
-     * <code>optional string source = 17;</code>
-     *
      * <pre>
      * From the bbox field.
      * </pre>
+     *
+     * <code>optional string source = 17;</code>
      */
     public java.lang.String getSource() {
-      java.lang.Object ref = source_;
-      if (ref instanceof java.lang.String) {
-        return (java.lang.String) ref;
-      } else {
-        com.google.protobuf.ByteString bs = 
-            (com.google.protobuf.ByteString) ref;
-        java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          source_ = s;
-        }
-        return s;
-      }
+      return source_;
     }
     /**
-     * <code>optional string source = 17;</code>
-     *
      * <pre>
      * From the bbox field.
      * </pre>
+     *
+     * <code>optional string source = 17;</code>
      */
     public com.google.protobuf.ByteString
         getSourceBytes() {
-      java.lang.Object ref = source_;
-      if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
-            com.google.protobuf.ByteString.copyFromUtf8(
-                (java.lang.String) ref);
-        source_ = b;
-        return b;
-      } else {
-        return (com.google.protobuf.ByteString) ref;
-      }
+      return com.google.protobuf.ByteString.copyFromUtf8(source_);
     }
-
-    public static final int OSMOSIS_REPLICATION_TIMESTAMP_FIELD_NUMBER = 32;
-    private long osmosisReplicationTimestamp_;
     /**
-     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-     *
      * <pre>
-     * replication timestamp, expressed in seconds since the epoch, 
-     * otherwise the same value as in the "timestamp=..." field
-     * in the state.txt file used by Osmosis
+     * From the bbox field.
      * </pre>
-     */
+     *
+     * <code>optional string source = 17;</code>
+     */
+    private void setSource(
+        java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000004;
+      source_ = value;
+    }
+    /**
+     * <pre>
+     * From the bbox field.
+     * </pre>
+     *
+     * <code>optional string source = 17;</code>
+     */
+    private void clearSource() {
+      bitField0_ = (bitField0_ & ~0x00000004);
+      source_ = getDefaultInstance().getSource();
+    }
+    /**
+     * <pre>
+     * From the bbox field.
+     * </pre>
+     *
+     * <code>optional string source = 17;</code>
+     */
+    private void setSourceBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000004;
+      source_ = value.toStringUtf8();
+    }
+
+    public static final int OSMOSIS_REPLICATION_TIMESTAMP_FIELD_NUMBER = 32;
+    private long osmosisReplicationTimestamp_;
+    /**
+     * <pre>
+     * replication timestamp, expressed in seconds since the epoch, 
+     * otherwise the same value as in the "timestamp=..." field
+     * in the state.txt file used by Osmosis
+     * </pre>
+     *
+     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
+     */
     public boolean hasOsmosisReplicationTimestamp() {
       return ((bitField0_ & 0x00000008) == 0x00000008);
     }
     /**
-     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-     *
      * <pre>
      * replication timestamp, expressed in seconds since the epoch, 
      * otherwise the same value as in the "timestamp=..." field
      * in the state.txt file used by Osmosis
      * </pre>
+     *
+     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
      */
     public long getOsmosisReplicationTimestamp() {
       return osmosisReplicationTimestamp_;
     }
+    /**
+     * <pre>
+     * replication timestamp, expressed in seconds since the epoch, 
+     * otherwise the same value as in the "timestamp=..." field
+     * in the state.txt file used by Osmosis
+     * </pre>
+     *
+     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
+     */
+    private void setOsmosisReplicationTimestamp(long value) {
+      bitField0_ |= 0x00000008;
+      osmosisReplicationTimestamp_ = value;
+    }
+    /**
+     * <pre>
+     * replication timestamp, expressed in seconds since the epoch, 
+     * otherwise the same value as in the "timestamp=..." field
+     * in the state.txt file used by Osmosis
+     * </pre>
+     *
+     * <code>optional int64 osmosis_replication_timestamp = 32;</code>
+     */
+    private void clearOsmosisReplicationTimestamp() {
+      bitField0_ = (bitField0_ & ~0x00000008);
+      osmosisReplicationTimestamp_ = 0L;
+    }
 
     public static final int OSMOSIS_REPLICATION_SEQUENCE_NUMBER_FIELD_NUMBER = 33;
     private long osmosisReplicationSequenceNumber_;
     /**
-     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-     *
      * <pre>
      * replication sequence number (sequenceNumber in state.txt)
      * </pre>
+     *
+     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
      */
     public boolean hasOsmosisReplicationSequenceNumber() {
       return ((bitField0_ & 0x00000010) == 0x00000010);
     }
     /**
-     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-     *
      * <pre>
      * replication sequence number (sequenceNumber in state.txt)
      * </pre>
+     *
+     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
      */
     public long getOsmosisReplicationSequenceNumber() {
       return osmosisReplicationSequenceNumber_;
     }
+    /**
+     * <pre>
+     * replication sequence number (sequenceNumber in state.txt)
+     * </pre>
+     *
+     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
+     */
+    private void setOsmosisReplicationSequenceNumber(long value) {
+      bitField0_ |= 0x00000010;
+      osmosisReplicationSequenceNumber_ = value;
+    }
+    /**
+     * <pre>
+     * replication sequence number (sequenceNumber in state.txt)
+     * </pre>
+     *
+     * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
+     */
+    private void clearOsmosisReplicationSequenceNumber() {
+      bitField0_ = (bitField0_ & ~0x00000010);
+      osmosisReplicationSequenceNumber_ = 0L;
+    }
 
     public static final int OSMOSIS_REPLICATION_BASE_URL_FIELD_NUMBER = 34;
-    private java.lang.Object osmosisReplicationBaseUrl_;
+    private java.lang.String osmosisReplicationBaseUrl_;
     /**
-     * <code>optional string osmosis_replication_base_url = 34;</code>
-     *
      * <pre>
      * replication base URL (from Osmosis' configuration.txt file)
      * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
      */
     public boolean hasOsmosisReplicationBaseUrl() {
       return ((bitField0_ & 0x00000020) == 0x00000020);
     }
     /**
-     * <code>optional string osmosis_replication_base_url = 34;</code>
-     *
      * <pre>
      * replication base URL (from Osmosis' configuration.txt file)
      * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
      */
     public java.lang.String getOsmosisReplicationBaseUrl() {
-      java.lang.Object ref = osmosisReplicationBaseUrl_;
-      if (ref instanceof java.lang.String) {
-        return (java.lang.String) ref;
-      } else {
-        com.google.protobuf.ByteString bs = 
-            (com.google.protobuf.ByteString) ref;
-        java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          osmosisReplicationBaseUrl_ = s;
-        }
-        return s;
-      }
+      return osmosisReplicationBaseUrl_;
     }
     /**
-     * <code>optional string osmosis_replication_base_url = 34;</code>
-     *
      * <pre>
      * replication base URL (from Osmosis' configuration.txt file)
      * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
      */
     public com.google.protobuf.ByteString
         getOsmosisReplicationBaseUrlBytes() {
-      java.lang.Object ref = osmosisReplicationBaseUrl_;
-      if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
-            com.google.protobuf.ByteString.copyFromUtf8(
-                (java.lang.String) ref);
-        osmosisReplicationBaseUrl_ = b;
-        return b;
-      } else {
-        return (com.google.protobuf.ByteString) ref;
-      }
+      return com.google.protobuf.ByteString.copyFromUtf8(osmosisReplicationBaseUrl_);
     }
-
-    private void initFields() {
-      bbox_ = org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance();
-      requiredFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-      optionalFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-      writingprogram_ = "";
-      source_ = "";
-      osmosisReplicationTimestamp_ = 0L;
-      osmosisReplicationSequenceNumber_ = 0L;
-      osmosisReplicationBaseUrl_ = "";
+    /**
+     * <pre>
+     * replication base URL (from Osmosis' configuration.txt file)
+     * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
+     */
+    private void setOsmosisReplicationBaseUrl(
+        java.lang.String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000020;
+      osmosisReplicationBaseUrl_ = value;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      if (hasBbox()) {
-        if (!getBbox().isInitialized()) {
-          memoizedIsInitialized = 0;
-          return false;
-        }
-      }
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <pre>
+     * replication base URL (from Osmosis' configuration.txt file)
+     * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
+     */
+    private void clearOsmosisReplicationBaseUrl() {
+      bitField0_ = (bitField0_ & ~0x00000020);
+      osmosisReplicationBaseUrl_ = getDefaultInstance().getOsmosisReplicationBaseUrl();
+    }
+    /**
+     * <pre>
+     * replication base URL (from Osmosis' configuration.txt file)
+     * </pre>
+     *
+     * <code>optional string osmosis_replication_base_url = 34;</code>
+     */
+    private void setOsmosisReplicationBaseUrlBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000020;
+      osmosisReplicationBaseUrl_ = value.toStringUtf8();
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeMessage(1, bbox_);
+        output.writeMessage(1, getBbox());
       }
       for (int i = 0; i < requiredFeatures_.size(); i++) {
-        output.writeBytes(4, requiredFeatures_.getByteString(i));
+        output.writeString(4, requiredFeatures_.get(i));
       }
       for (int i = 0; i < optionalFeatures_.size(); i++) {
-        output.writeBytes(5, optionalFeatures_.getByteString(i));
+        output.writeString(5, optionalFeatures_.get(i));
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
-        output.writeBytes(16, getWritingprogramBytes());
+        output.writeString(16, getWritingprogram());
       }
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
-        output.writeBytes(17, getSourceBytes());
+        output.writeString(17, getSource());
       }
       if (((bitField0_ & 0x00000008) == 0x00000008)) {
         output.writeInt64(32, osmosisReplicationTimestamp_);
@@ -668,12 +772,11 @@ public final class Osmformat {
         output.writeInt64(33, osmosisReplicationSequenceNumber_);
       }
       if (((bitField0_ & 0x00000020) == 0x00000020)) {
-        output.writeBytes(34, getOsmosisReplicationBaseUrlBytes());
+        output.writeString(34, getOsmosisReplicationBaseUrl());
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -681,13 +784,13 @@ public final class Osmformat {
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(1, bbox_);
+          .computeMessageSize(1, getBbox());
       }
       {
         int dataSize = 0;
         for (int i = 0; i < requiredFeatures_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeBytesSizeNoTag(requiredFeatures_.getByteString(i));
+            .computeStringSizeNoTag(requiredFeatures_.get(i));
         }
         size += dataSize;
         size += 1 * getRequiredFeaturesList().size();
@@ -696,18 +799,18 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < optionalFeatures_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeBytesSizeNoTag(optionalFeatures_.getByteString(i));
+            .computeStringSizeNoTag(optionalFeatures_.get(i));
         }
         size += dataSize;
         size += 1 * getOptionalFeaturesList().size();
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(16, getWritingprogramBytes());
+          .computeStringSize(16, getWritingprogram());
       }
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(17, getSourceBytes());
+          .computeStringSize(17, getSource());
       }
       if (((bitField0_ & 0x00000008) == 0x00000008)) {
         size += com.google.protobuf.CodedOutputStream
@@ -719,492 +822,282 @@ public final class Osmformat {
       }
       if (((bitField0_ & 0x00000020) == 0x00000020)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(34, getOsmosisReplicationBaseUrlBytes());
+          .computeStringSize(34, getOsmosisReplicationBaseUrl());
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.HeaderBlock}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.HeaderBlock)
         org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlockOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        bbox_ = org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        requiredFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        optionalFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000004);
-        writingprogram_ = "";
-        bitField0_ = (bitField0_ & ~0x00000008);
-        source_ = "";
-        bitField0_ = (bitField0_ & ~0x00000010);
-        osmosisReplicationTimestamp_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000020);
-        osmosisReplicationSequenceNumber_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000040);
-        osmosisReplicationBaseUrl_ = "";
-        bitField0_ = (bitField0_ & ~0x00000080);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock result = new org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.bbox_ = bbox_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          requiredFeatures_ = requiredFeatures_.getUnmodifiableView();
-          bitField0_ = (bitField0_ & ~0x00000002);
-        }
-        result.requiredFeatures_ = requiredFeatures_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          optionalFeatures_ = optionalFeatures_.getUnmodifiableView();
-          bitField0_ = (bitField0_ & ~0x00000004);
-        }
-        result.optionalFeatures_ = optionalFeatures_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.writingprogram_ = writingprogram_;
-        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
-          to_bitField0_ |= 0x00000004;
-        }
-        result.source_ = source_;
-        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
-          to_bitField0_ |= 0x00000008;
-        }
-        result.osmosisReplicationTimestamp_ = osmosisReplicationTimestamp_;
-        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
-          to_bitField0_ |= 0x00000010;
-        }
-        result.osmosisReplicationSequenceNumber_ = osmosisReplicationSequenceNumber_;
-        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
-          to_bitField0_ |= 0x00000020;
-        }
-        result.osmosisReplicationBaseUrl_ = osmosisReplicationBaseUrl_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock.getDefaultInstance()) return this;
-        if (other.hasBbox()) {
-          mergeBbox(other.getBbox());
-        }
-        if (!other.requiredFeatures_.isEmpty()) {
-          if (requiredFeatures_.isEmpty()) {
-            requiredFeatures_ = other.requiredFeatures_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensureRequiredFeaturesIsMutable();
-            requiredFeatures_.addAll(other.requiredFeatures_);
-          }
-          
-        }
-        if (!other.optionalFeatures_.isEmpty()) {
-          if (optionalFeatures_.isEmpty()) {
-            optionalFeatures_ = other.optionalFeatures_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureOptionalFeaturesIsMutable();
-            optionalFeatures_.addAll(other.optionalFeatures_);
-          }
-          
-        }
-        if (other.hasWritingprogram()) {
-          bitField0_ |= 0x00000008;
-          writingprogram_ = other.writingprogram_;
-          
-        }
-        if (other.hasSource()) {
-          bitField0_ |= 0x00000010;
-          source_ = other.source_;
-          
-        }
-        if (other.hasOsmosisReplicationTimestamp()) {
-          setOsmosisReplicationTimestamp(other.getOsmosisReplicationTimestamp());
-        }
-        if (other.hasOsmosisReplicationSequenceNumber()) {
-          setOsmosisReplicationSequenceNumber(other.getOsmosisReplicationSequenceNumber());
-        }
-        if (other.hasOsmosisReplicationBaseUrl()) {
-          bitField0_ |= 0x00000080;
-          osmosisReplicationBaseUrl_ = other.osmosisReplicationBaseUrl_;
-          
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
+        super(DEFAULT_INSTANCE);
       }
 
-      public final boolean isInitialized() {
-        if (hasBbox()) {
-          if (!getBbox().isInitialized()) {
-            
-            return false;
-          }
-        }
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox bbox_ = org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance();
       /**
        * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
        */
       public boolean hasBbox() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasBbox();
       }
       /**
        * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox getBbox() {
-        return bbox_;
+        return instance.getBbox();
       }
       /**
        * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
        */
       public Builder setBbox(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        bbox_ = value;
-
-        bitField0_ |= 0x00000001;
+        copyOnWrite();
+        instance.setBbox(value);
         return this;
-      }
+        }
       /**
        * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
        */
       public Builder setBbox(
           org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.Builder builderForValue) {
-        bbox_ = builderForValue.build();
-
-        bitField0_ |= 0x00000001;
+        copyOnWrite();
+        instance.setBbox(builderForValue);
         return this;
       }
       /**
        * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
        */
       public Builder mergeBbox(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox value) {
-        if (((bitField0_ & 0x00000001) == 0x00000001) &&
-            bbox_ != org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance()) {
-          bbox_ =
-            org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.newBuilder(bbox_).mergeFrom(value).buildPartial();
-        } else {
-          bbox_ = value;
-        }
-
-        bitField0_ |= 0x00000001;
+        copyOnWrite();
+        instance.mergeBbox(value);
         return this;
       }
       /**
        * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code>
        */
-      public Builder clearBbox() {
-        bbox_ = org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance();
-
-        bitField0_ = (bitField0_ & ~0x00000001);
+      public Builder clearBbox() {  copyOnWrite();
+        instance.clearBbox();
         return this;
       }
 
-      private com.google.protobuf.LazyStringList requiredFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-      private void ensureRequiredFeaturesIsMutable() {
-        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          requiredFeatures_ = new com.google.protobuf.LazyStringArrayList(requiredFeatures_);
-          bitField0_ |= 0x00000002;
-         }
-      }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
-      public com.google.protobuf.ProtocolStringList
+      public java.util.List<String>
           getRequiredFeaturesList() {
-        return requiredFeatures_.getUnmodifiableView();
+        return java.util.Collections.unmodifiableList(
+            instance.getRequiredFeaturesList());
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public int getRequiredFeaturesCount() {
-        return requiredFeatures_.size();
+        return instance.getRequiredFeaturesCount();
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public java.lang.String getRequiredFeatures(int index) {
-        return requiredFeatures_.get(index);
+        return instance.getRequiredFeatures(index);
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public com.google.protobuf.ByteString
           getRequiredFeaturesBytes(int index) {
-        return requiredFeatures_.getByteString(index);
+        return instance.getRequiredFeaturesBytes(index);
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public Builder setRequiredFeatures(
           int index, java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureRequiredFeaturesIsMutable();
-        requiredFeatures_.set(index, value);
-        
+        copyOnWrite();
+        instance.setRequiredFeatures(index, value);
         return this;
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public Builder addRequiredFeatures(
           java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureRequiredFeaturesIsMutable();
-        requiredFeatures_.add(value);
-        
+        copyOnWrite();
+        instance.addRequiredFeatures(value);
         return this;
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public Builder addAllRequiredFeatures(
           java.lang.Iterable<java.lang.String> values) {
-        ensureRequiredFeaturesIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, requiredFeatures_);
-        
+        copyOnWrite();
+        instance.addAllRequiredFeatures(values);
         return this;
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public Builder clearRequiredFeatures() {
-        requiredFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        
+        copyOnWrite();
+        instance.clearRequiredFeatures();
         return this;
       }
       /**
-       * <code>repeated string required_features = 4;</code>
-       *
        * <pre>
        * Additional tags to aid in parsing this dataset 
        * </pre>
+       *
+       * <code>repeated string required_features = 4;</code>
        */
       public Builder addRequiredFeaturesBytes(
           com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureRequiredFeaturesIsMutable();
-        requiredFeatures_.add(value);
-        
+        copyOnWrite();
+        instance.addRequiredFeaturesBytes(value);
         return this;
       }
 
-      private com.google.protobuf.LazyStringList optionalFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-      private void ensureOptionalFeaturesIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          optionalFeatures_ = new com.google.protobuf.LazyStringArrayList(optionalFeatures_);
-          bitField0_ |= 0x00000004;
-         }
-      }
       /**
        * <code>repeated string optional_features = 5;</code>
        */
-      public com.google.protobuf.ProtocolStringList
+      public java.util.List<String>
           getOptionalFeaturesList() {
-        return optionalFeatures_.getUnmodifiableView();
+        return java.util.Collections.unmodifiableList(
+            instance.getOptionalFeaturesList());
       }
       /**
        * <code>repeated string optional_features = 5;</code>
        */
       public int getOptionalFeaturesCount() {
-        return optionalFeatures_.size();
+        return instance.getOptionalFeaturesCount();
       }
       /**
        * <code>repeated string optional_features = 5;</code>
        */
       public java.lang.String getOptionalFeatures(int index) {
-        return optionalFeatures_.get(index);
+        return instance.getOptionalFeatures(index);
       }
       /**
        * <code>repeated string optional_features = 5;</code>
        */
       public com.google.protobuf.ByteString
           getOptionalFeaturesBytes(int index) {
-        return optionalFeatures_.getByteString(index);
+        return instance.getOptionalFeaturesBytes(index);
       }
       /**
        * <code>repeated string optional_features = 5;</code>
        */
       public Builder setOptionalFeatures(
           int index, java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureOptionalFeaturesIsMutable();
-        optionalFeatures_.set(index, value);
-        
+        copyOnWrite();
+        instance.setOptionalFeatures(index, value);
         return this;
       }
       /**
@@ -1212,12 +1105,8 @@ public final class Osmformat {
        */
       public Builder addOptionalFeatures(
           java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureOptionalFeaturesIsMutable();
-        optionalFeatures_.add(value);
-        
+        copyOnWrite();
+        instance.addOptionalFeatures(value);
         return this;
       }
       /**
@@ -1225,19 +1114,16 @@ public final class Osmformat {
        */
       public Builder addAllOptionalFeatures(
           java.lang.Iterable<java.lang.String> values) {
-        ensureOptionalFeaturesIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, optionalFeatures_);
-        
+        copyOnWrite();
+        instance.addAllOptionalFeatures(values);
         return this;
       }
       /**
        * <code>repeated string optional_features = 5;</code>
        */
       public Builder clearOptionalFeatures() {
-        optionalFeatures_ = com.google.protobuf.LazyStringArrayList.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000004);
-        
+        copyOnWrite();
+        instance.clearOptionalFeatures();
         return this;
       }
       /**
@@ -1245,75 +1131,45 @@ public final class Osmformat {
        */
       public Builder addOptionalFeaturesBytes(
           com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureOptionalFeaturesIsMutable();
-        optionalFeatures_.add(value);
-        
+        copyOnWrite();
+        instance.addOptionalFeaturesBytes(value);
         return this;
       }
 
-      private java.lang.Object writingprogram_ = "";
       /**
        * <code>optional string writingprogram = 16;</code>
        */
       public boolean hasWritingprogram() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasWritingprogram();
       }
       /**
        * <code>optional string writingprogram = 16;</code>
        */
       public java.lang.String getWritingprogram() {
-        java.lang.Object ref = writingprogram_;
-        if (!(ref instanceof java.lang.String)) {
-          com.google.protobuf.ByteString bs =
-              (com.google.protobuf.ByteString) ref;
-          java.lang.String s = bs.toStringUtf8();
-          if (bs.isValidUtf8()) {
-            writingprogram_ = s;
-          }
-          return s;
-        } else {
-          return (java.lang.String) ref;
-        }
+        return instance.getWritingprogram();
       }
       /**
        * <code>optional string writingprogram = 16;</code>
        */
       public com.google.protobuf.ByteString
           getWritingprogramBytes() {
-        java.lang.Object ref = writingprogram_;
-        if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
-              com.google.protobuf.ByteString.copyFromUtf8(
-                  (java.lang.String) ref);
-          writingprogram_ = b;
-          return b;
-        } else {
-          return (com.google.protobuf.ByteString) ref;
-        }
+        return instance.getWritingprogramBytes();
       }
       /**
        * <code>optional string writingprogram = 16;</code>
        */
       public Builder setWritingprogram(
           java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000008;
-        writingprogram_ = value;
-        
+        copyOnWrite();
+        instance.setWritingprogram(value);
         return this;
       }
       /**
        * <code>optional string writingprogram = 16;</code>
        */
       public Builder clearWritingprogram() {
-        bitField0_ = (bitField0_ & ~0x00000008);
-        writingprogram_ = getDefaultInstance().getWritingprogram();
-        
+        copyOnWrite();
+        instance.clearWritingprogram();
         return this;
       }
       /**
@@ -1321,328 +1177,434 @@ public final class Osmformat {
        */
       public Builder setWritingprogramBytes(
           com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000008;
-        writingprogram_ = value;
-        
+        copyOnWrite();
+        instance.setWritingprogramBytes(value);
         return this;
       }
 
-      private java.lang.Object source_ = "";
       /**
-       * <code>optional string source = 17;</code>
-       *
        * <pre>
        * From the bbox field.
        * </pre>
+       *
+       * <code>optional string source = 17;</code>
        */
       public boolean hasSource() {
-        return ((bitField0_ & 0x00000010) == 0x00000010);
+        return instance.hasSource();
       }
       /**
-       * <code>optional string source = 17;</code>
-       *
        * <pre>
        * From the bbox field.
        * </pre>
+       *
+       * <code>optional string source = 17;</code>
        */
       public java.lang.String getSource() {
-        java.lang.Object ref = source_;
-        if (!(ref instanceof java.lang.String)) {
-          com.google.protobuf.ByteString bs =
-              (com.google.protobuf.ByteString) ref;
-          java.lang.String s = bs.toStringUtf8();
-          if (bs.isValidUtf8()) {
-            source_ = s;
-          }
-          return s;
-        } else {
-          return (java.lang.String) ref;
-        }
+        return instance.getSource();
       }
       /**
-       * <code>optional string source = 17;</code>
-       *
        * <pre>
        * From the bbox field.
        * </pre>
+       *
+       * <code>optional string source = 17;</code>
        */
       public com.google.protobuf.ByteString
           getSourceBytes() {
-        java.lang.Object ref = source_;
-        if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
-              com.google.protobuf.ByteString.copyFromUtf8(
-                  (java.lang.String) ref);
-          source_ = b;
-          return b;
-        } else {
-          return (com.google.protobuf.ByteString) ref;
-        }
+        return instance.getSourceBytes();
       }
       /**
-       * <code>optional string source = 17;</code>
-       *
        * <pre>
        * From the bbox field.
        * </pre>
+       *
+       * <code>optional string source = 17;</code>
        */
       public Builder setSource(
           java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000010;
-        source_ = value;
-        
+        copyOnWrite();
+        instance.setSource(value);
         return this;
       }
       /**
-       * <code>optional string source = 17;</code>
-       *
        * <pre>
        * From the bbox field.
        * </pre>
+       *
+       * <code>optional string source = 17;</code>
        */
       public Builder clearSource() {
-        bitField0_ = (bitField0_ & ~0x00000010);
-        source_ = getDefaultInstance().getSource();
-        
+        copyOnWrite();
+        instance.clearSource();
         return this;
       }
       /**
-       * <code>optional string source = 17;</code>
-       *
        * <pre>
        * From the bbox field.
        * </pre>
+       *
+       * <code>optional string source = 17;</code>
        */
       public Builder setSourceBytes(
           com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000010;
-        source_ = value;
-        
+        copyOnWrite();
+        instance.setSourceBytes(value);
         return this;
       }
 
-      private long osmosisReplicationTimestamp_ ;
       /**
-       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-       *
        * <pre>
        * replication timestamp, expressed in seconds since the epoch, 
        * otherwise the same value as in the "timestamp=..." field
        * in the state.txt file used by Osmosis
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
        */
       public boolean hasOsmosisReplicationTimestamp() {
-        return ((bitField0_ & 0x00000020) == 0x00000020);
+        return instance.hasOsmosisReplicationTimestamp();
       }
       /**
-       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-       *
        * <pre>
        * replication timestamp, expressed in seconds since the epoch, 
        * otherwise the same value as in the "timestamp=..." field
        * in the state.txt file used by Osmosis
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
        */
       public long getOsmosisReplicationTimestamp() {
-        return osmosisReplicationTimestamp_;
+        return instance.getOsmosisReplicationTimestamp();
       }
       /**
-       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-       *
        * <pre>
        * replication timestamp, expressed in seconds since the epoch, 
        * otherwise the same value as in the "timestamp=..." field
        * in the state.txt file used by Osmosis
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
        */
       public Builder setOsmosisReplicationTimestamp(long value) {
-        bitField0_ |= 0x00000020;
-        osmosisReplicationTimestamp_ = value;
-        
+        copyOnWrite();
+        instance.setOsmosisReplicationTimestamp(value);
         return this;
       }
       /**
-       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
-       *
        * <pre>
        * replication timestamp, expressed in seconds since the epoch, 
        * otherwise the same value as in the "timestamp=..." field
        * in the state.txt file used by Osmosis
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_timestamp = 32;</code>
        */
       public Builder clearOsmosisReplicationTimestamp() {
-        bitField0_ = (bitField0_ & ~0x00000020);
-        osmosisReplicationTimestamp_ = 0L;
-        
+        copyOnWrite();
+        instance.clearOsmosisReplicationTimestamp();
         return this;
       }
 
-      private long osmosisReplicationSequenceNumber_ ;
       /**
-       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-       *
        * <pre>
        * replication sequence number (sequenceNumber in state.txt)
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
        */
       public boolean hasOsmosisReplicationSequenceNumber() {
-        return ((bitField0_ & 0x00000040) == 0x00000040);
+        return instance.hasOsmosisReplicationSequenceNumber();
       }
       /**
-       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-       *
        * <pre>
        * replication sequence number (sequenceNumber in state.txt)
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
        */
       public long getOsmosisReplicationSequenceNumber() {
-        return osmosisReplicationSequenceNumber_;
+        return instance.getOsmosisReplicationSequenceNumber();
       }
       /**
-       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-       *
        * <pre>
        * replication sequence number (sequenceNumber in state.txt)
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
        */
       public Builder setOsmosisReplicationSequenceNumber(long value) {
-        bitField0_ |= 0x00000040;
-        osmosisReplicationSequenceNumber_ = value;
-        
+        copyOnWrite();
+        instance.setOsmosisReplicationSequenceNumber(value);
         return this;
       }
       /**
-       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
-       *
        * <pre>
        * replication sequence number (sequenceNumber in state.txt)
        * </pre>
+       *
+       * <code>optional int64 osmosis_replication_sequence_number = 33;</code>
        */
       public Builder clearOsmosisReplicationSequenceNumber() {
-        bitField0_ = (bitField0_ & ~0x00000040);
-        osmosisReplicationSequenceNumber_ = 0L;
-        
+        copyOnWrite();
+        instance.clearOsmosisReplicationSequenceNumber();
         return this;
       }
 
-      private java.lang.Object osmosisReplicationBaseUrl_ = "";
       /**
-       * <code>optional string osmosis_replication_base_url = 34;</code>
-       *
        * <pre>
        * replication base URL (from Osmosis' configuration.txt file)
        * </pre>
+       *
+       * <code>optional string osmosis_replication_base_url = 34;</code>
        */
       public boolean hasOsmosisReplicationBaseUrl() {
-        return ((bitField0_ & 0x00000080) == 0x00000080);
+        return instance.hasOsmosisReplicationBaseUrl();
       }
       /**
-       * <code>optional string osmosis_replication_base_url = 34;</code>
-       *
        * <pre>
        * replication base URL (from Osmosis' configuration.txt file)
        * </pre>
+       *
+       * <code>optional string osmosis_replication_base_url = 34;</code>
        */
       public java.lang.String getOsmosisReplicationBaseUrl() {
-        java.lang.Object ref = osmosisReplicationBaseUrl_;
-        if (!(ref instanceof java.lang.String)) {
-          com.google.protobuf.ByteString bs =
-              (com.google.protobuf.ByteString) ref;
-          java.lang.String s = bs.toStringUtf8();
-          if (bs.isValidUtf8()) {
-            osmosisReplicationBaseUrl_ = s;
-          }
-          return s;
-        } else {
-          return (java.lang.String) ref;
-        }
+        return instance.getOsmosisReplicationBaseUrl();
       }
       /**
-       * <code>optional string osmosis_replication_base_url = 34;</code>
-       *
        * <pre>
        * replication base URL (from Osmosis' configuration.txt file)
        * </pre>
+       *
+       * <code>optional string osmosis_replication_base_url = 34;</code>
        */
       public com.google.protobuf.ByteString
           getOsmosisReplicationBaseUrlBytes() {
-        java.lang.Object ref = osmosisReplicationBaseUrl_;
-        if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
-              com.google.protobuf.ByteString.copyFromUtf8(
-                  (java.lang.String) ref);
-          osmosisReplicationBaseUrl_ = b;
-          return b;
-        } else {
-          return (com.google.protobuf.ByteString) ref;
-        }
+        return instance.getOsmosisReplicationBaseUrlBytes();
       }
       /**
-       * <code>optional string osmosis_replication_base_url = 34;</code>
-       *
        * <pre>
        * replication base URL (from Osmosis' configuration.txt file)
        * </pre>
+       *
+       * <code>optional string osmosis_replication_base_url = 34;</code>
        */
       public Builder setOsmosisReplicationBaseUrl(
           java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000080;
-        osmosisReplicationBaseUrl_ = value;
-        
+        copyOnWrite();
+        instance.setOsmosisReplicationBaseUrl(value);
         return this;
       }
       /**
-       * <code>optional string osmosis_replication_base_url = 34;</code>
-       *
        * <pre>
        * replication base URL (from Osmosis' configuration.txt file)
        * </pre>
+       *
+       * <code>optional string osmosis_replication_base_url = 34;</code>
        */
       public Builder clearOsmosisReplicationBaseUrl() {
-        bitField0_ = (bitField0_ & ~0x00000080);
-        osmosisReplicationBaseUrl_ = getDefaultInstance().getOsmosisReplicationBaseUrl();
-        
+        copyOnWrite();
+        instance.clearOsmosisReplicationBaseUrl();
         return this;
       }
       /**
-       * <code>optional string osmosis_replication_base_url = 34;</code>
-       *
        * <pre>
        * replication base URL (from Osmosis' configuration.txt file)
        * </pre>
+       *
+       * <code>optional string osmosis_replication_base_url = 34;</code>
        */
       public Builder setOsmosisReplicationBaseUrlBytes(
           com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000080;
-        osmosisReplicationBaseUrl_ = value;
-        
+        copyOnWrite();
+        instance.setOsmosisReplicationBaseUrlBytes(value);
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.HeaderBlock)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (hasBbox()) {
+            if (!getBbox().isInitialized()) {
+              if (shouldMemoize) {
+                memoizedIsInitialized = 0;
+              }
+              return null;
+            }
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
+
+        }
+        case MAKE_IMMUTABLE: {
+          requiredFeatures_.makeImmutable();
+          optionalFeatures_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock other = (org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock) arg1;
+          bbox_ = visitor.visitMessage(bbox_, other.bbox_);
+          requiredFeatures_= visitor.visitList(requiredFeatures_, other.requiredFeatures_);
+          optionalFeatures_= visitor.visitList(optionalFeatures_, other.optionalFeatures_);
+          writingprogram_ = visitor.visitString(
+              hasWritingprogram(), writingprogram_,
+              other.hasWritingprogram(), other.writingprogram_);
+          source_ = visitor.visitString(
+              hasSource(), source_,
+              other.hasSource(), other.source_);
+          osmosisReplicationTimestamp_ = visitor.visitLong(
+              hasOsmosisReplicationTimestamp(), osmosisReplicationTimestamp_,
+              other.hasOsmosisReplicationTimestamp(), other.osmosisReplicationTimestamp_);
+          osmosisReplicationSequenceNumber_ = visitor.visitLong(
+              hasOsmosisReplicationSequenceNumber(), osmosisReplicationSequenceNumber_,
+              other.hasOsmosisReplicationSequenceNumber(), other.osmosisReplicationSequenceNumber_);
+          osmosisReplicationBaseUrl_ = visitor.visitString(
+              hasOsmosisReplicationBaseUrl(), osmosisReplicationBaseUrl_,
+              other.hasOsmosisReplicationBaseUrl(), other.osmosisReplicationBaseUrl_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 10: {
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.Builder subBuilder = null;
+                  if (((bitField0_ & 0x00000001) == 0x00000001)) {
+                    subBuilder = bbox_.toBuilder();
+                  }
+                  bbox_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.parser(), extensionRegistry);
+                  if (subBuilder != null) {
+                    subBuilder.mergeFrom(bbox_);
+                    bbox_ = subBuilder.buildPartial();
+                  }
+                  bitField0_ |= 0x00000001;
+                  break;
+                }
+                case 34: {
+                  String s = input.readString();
+                  if (!requiredFeatures_.isModifiable()) {
+                    requiredFeatures_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(requiredFeatures_);
+                  }
+                  requiredFeatures_.add(s);
+                  break;
+                }
+                case 42: {
+                  String s = input.readString();
+                  if (!optionalFeatures_.isModifiable()) {
+                    optionalFeatures_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(optionalFeatures_);
+                  }
+                  optionalFeatures_.add(s);
+                  break;
+                }
+                case 130: {
+                  String s = input.readString();
+                  bitField0_ |= 0x00000002;
+                  writingprogram_ = s;
+                  break;
+                }
+                case 138: {
+                  String s = input.readString();
+                  bitField0_ |= 0x00000004;
+                  source_ = s;
+                  break;
+                }
+                case 256: {
+                  bitField0_ |= 0x00000008;
+                  osmosisReplicationTimestamp_ = input.readInt64();
+                  break;
+                }
+                case 264: {
+                  bitField0_ |= 0x00000010;
+                  osmosisReplicationSequenceNumber_ = input.readInt64();
+                  break;
+                }
+                case 274: {
+                  String s = input.readString();
+                  bitField0_ |= 0x00000020;
+                  osmosisReplicationBaseUrl_ = s;
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
 
+
+    // @@protoc_insertion_point(class_scope:OSMPBF.HeaderBlock)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock DEFAULT_INSTANCE;
     static {
-      defaultInstance = new HeaderBlock(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new HeaderBlock();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.HeaderBlock)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBlock getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<HeaderBlock> PARSER;
+
+    public static com.google.protobuf.Parser<HeaderBlock> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface HeaderBBoxOrBuilder extends
@@ -1688,106 +1650,13 @@ public final class Osmformat {
   /**
    * Protobuf type {@code OSMPBF.HeaderBBox}
    */
-  public static final class HeaderBBox extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class HeaderBBox extends
+      com.google.protobuf.GeneratedMessageLite<
+          HeaderBBox, HeaderBBox.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.HeaderBBox)
       HeaderBBoxOrBuilder {
-    // Use HeaderBBox.newBuilder() to construct.
-    private HeaderBBox(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private HeaderBBox(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final HeaderBBox defaultInstance;
-    public static HeaderBBox getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public HeaderBBox getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private HeaderBBox(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              bitField0_ |= 0x00000001;
-              left_ = input.readSInt64();
-              break;
-            }
-            case 16: {
-              bitField0_ |= 0x00000002;
-              right_ = input.readSInt64();
-              break;
-            }
-            case 24: {
-              bitField0_ |= 0x00000004;
-              top_ = input.readSInt64();
-              break;
-            }
-            case 32: {
-              bitField0_ |= 0x00000008;
-              bottom_ = input.readSInt64();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<HeaderBBox> PARSER =
-        new com.google.protobuf.AbstractParser<HeaderBBox>() {
-      public HeaderBBox parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new HeaderBBox(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<HeaderBBox> getParserForType() {
-      return PARSER;
+    private HeaderBBox() {
     }
-
     private int bitField0_;
     public static final int LEFT_FIELD_NUMBER = 1;
     private long left_;
@@ -1803,6 +1672,20 @@ public final class Osmformat {
     public long getLeft() {
       return left_;
     }
+    /**
+     * <code>required sint64 left = 1;</code>
+     */
+    private void setLeft(long value) {
+      bitField0_ |= 0x00000001;
+      left_ = value;
+    }
+    /**
+     * <code>required sint64 left = 1;</code>
+     */
+    private void clearLeft() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      left_ = 0L;
+    }
 
     public static final int RIGHT_FIELD_NUMBER = 2;
     private long right_;
@@ -1818,6 +1701,20 @@ public final class Osmformat {
     public long getRight() {
       return right_;
     }
+    /**
+     * <code>required sint64 right = 2;</code>
+     */
+    private void setRight(long value) {
+      bitField0_ |= 0x00000002;
+      right_ = value;
+    }
+    /**
+     * <code>required sint64 right = 2;</code>
+     */
+    private void clearRight() {
+      bitField0_ = (bitField0_ & ~0x00000002);
+      right_ = 0L;
+    }
 
     public static final int TOP_FIELD_NUMBER = 3;
     private long top_;
@@ -1833,6 +1730,20 @@ public final class Osmformat {
     public long getTop() {
       return top_;
     }
+    /**
+     * <code>required sint64 top = 3;</code>
+     */
+    private void setTop(long value) {
+      bitField0_ |= 0x00000004;
+      top_ = value;
+    }
+    /**
+     * <code>required sint64 top = 3;</code>
+     */
+    private void clearTop() {
+      bitField0_ = (bitField0_ & ~0x00000004);
+      top_ = 0L;
+    }
 
     public static final int BOTTOM_FIELD_NUMBER = 4;
     private long bottom_;
@@ -1848,42 +1759,23 @@ public final class Osmformat {
     public long getBottom() {
       return bottom_;
     }
-
-    private void initFields() {
-      left_ = 0L;
-      right_ = 0L;
-      top_ = 0L;
-      bottom_ = 0L;
+    /**
+     * <code>required sint64 bottom = 4;</code>
+     */
+    private void setBottom(long value) {
+      bitField0_ |= 0x00000008;
+      bottom_ = value;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      if (!hasLeft()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      if (!hasRight()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      if (!hasTop()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      if (!hasBottom()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <code>required sint64 bottom = 4;</code>
+     */
+    private void clearBottom() {
+      bitField0_ = (bitField0_ & ~0x00000008);
+      bottom_ = 0L;
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         output.writeSInt64(1, left_);
       }
@@ -1896,10 +1788,9 @@ public final class Osmformat {
       if (((bitField0_ & 0x00000008) == 0x00000008)) {
         output.writeSInt64(4, bottom_);
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -1921,358 +1812,375 @@ public final class Osmformat {
         size += com.google.protobuf.CodedOutputStream
           .computeSInt64Size(4, bottom_);
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.HeaderBBox}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.HeaderBBox)
         org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBoxOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        left_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        right_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        top_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000004);
-        bottom_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000008);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox result = new org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.left_ = left_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.right_ = right_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
-          to_bitField0_ |= 0x00000004;
-        }
-        result.top_ = top_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000008;
-        }
-        result.bottom_ = bottom_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance()) return this;
-        if (other.hasLeft()) {
-          setLeft(other.getLeft());
-        }
-        if (other.hasRight()) {
-          setRight(other.getRight());
-        }
-        if (other.hasTop()) {
-          setTop(other.getTop());
-        }
-        if (other.hasBottom()) {
-          setBottom(other.getBottom());
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        if (!hasLeft()) {
-          
-          return false;
-        }
-        if (!hasRight()) {
-          
-          return false;
-        }
-        if (!hasTop()) {
-          
-          return false;
-        }
-        if (!hasBottom()) {
-          
-          return false;
-        }
-        return true;
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private long left_ ;
       /**
        * <code>required sint64 left = 1;</code>
        */
       public boolean hasLeft() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasLeft();
       }
       /**
        * <code>required sint64 left = 1;</code>
        */
       public long getLeft() {
-        return left_;
+        return instance.getLeft();
       }
       /**
        * <code>required sint64 left = 1;</code>
        */
       public Builder setLeft(long value) {
-        bitField0_ |= 0x00000001;
-        left_ = value;
-        
+        copyOnWrite();
+        instance.setLeft(value);
         return this;
       }
       /**
        * <code>required sint64 left = 1;</code>
        */
       public Builder clearLeft() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        left_ = 0L;
-        
+        copyOnWrite();
+        instance.clearLeft();
         return this;
       }
 
-      private long right_ ;
       /**
        * <code>required sint64 right = 2;</code>
        */
       public boolean hasRight() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
+        return instance.hasRight();
       }
       /**
        * <code>required sint64 right = 2;</code>
        */
       public long getRight() {
-        return right_;
+        return instance.getRight();
       }
       /**
        * <code>required sint64 right = 2;</code>
        */
       public Builder setRight(long value) {
-        bitField0_ |= 0x00000002;
-        right_ = value;
-        
+        copyOnWrite();
+        instance.setRight(value);
         return this;
       }
       /**
        * <code>required sint64 right = 2;</code>
        */
       public Builder clearRight() {
-        bitField0_ = (bitField0_ & ~0x00000002);
-        right_ = 0L;
-        
+        copyOnWrite();
+        instance.clearRight();
         return this;
       }
 
-      private long top_ ;
       /**
        * <code>required sint64 top = 3;</code>
        */
       public boolean hasTop() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
+        return instance.hasTop();
       }
       /**
        * <code>required sint64 top = 3;</code>
        */
       public long getTop() {
-        return top_;
+        return instance.getTop();
       }
       /**
        * <code>required sint64 top = 3;</code>
        */
       public Builder setTop(long value) {
-        bitField0_ |= 0x00000004;
-        top_ = value;
-        
+        copyOnWrite();
+        instance.setTop(value);
         return this;
       }
       /**
        * <code>required sint64 top = 3;</code>
        */
       public Builder clearTop() {
-        bitField0_ = (bitField0_ & ~0x00000004);
-        top_ = 0L;
-        
+        copyOnWrite();
+        instance.clearTop();
         return this;
       }
 
-      private long bottom_ ;
       /**
        * <code>required sint64 bottom = 4;</code>
        */
       public boolean hasBottom() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasBottom();
       }
       /**
        * <code>required sint64 bottom = 4;</code>
        */
       public long getBottom() {
-        return bottom_;
+        return instance.getBottom();
       }
       /**
        * <code>required sint64 bottom = 4;</code>
        */
       public Builder setBottom(long value) {
-        bitField0_ |= 0x00000008;
-        bottom_ = value;
-        
+        copyOnWrite();
+        instance.setBottom(value);
         return this;
       }
       /**
        * <code>required sint64 bottom = 4;</code>
        */
       public Builder clearBottom() {
-        bitField0_ = (bitField0_ & ~0x00000008);
-        bottom_ = 0L;
-        
+        copyOnWrite();
+        instance.clearBottom();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.HeaderBBox)
     }
-
-    static {
-      defaultInstance = new HeaderBBox(true);
-      defaultInstance.initFields();
-    }
-
-    // @@protoc_insertion_point(class_scope:OSMPBF.HeaderBBox)
-  }
-
-  public interface PrimitiveBlockOrBuilder extends
-      // @@protoc_insertion_point(interface_extends:OSMPBF.PrimitiveBlock)
-      com.google.protobuf.MessageLiteOrBuilder {
-
-    /**
-     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
-     */
-    boolean hasStringtable();
-    /**
-     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (!hasLeft()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (!hasRight()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (!hasTop()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (!hasBottom()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
+
+        }
+        case MAKE_IMMUTABLE: {
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox other = (org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox) arg1;
+          left_ = visitor.visitLong(
+              hasLeft(), left_,
+              other.hasLeft(), other.left_);
+          right_ = visitor.visitLong(
+              hasRight(), right_,
+              other.hasRight(), other.right_);
+          top_ = visitor.visitLong(
+              hasTop(), top_,
+              other.hasTop(), other.top_);
+          bottom_ = visitor.visitLong(
+              hasBottom(), bottom_,
+              other.hasBottom(), other.bottom_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  bitField0_ |= 0x00000001;
+                  left_ = input.readSInt64();
+                  break;
+                }
+                case 16: {
+                  bitField0_ |= 0x00000002;
+                  right_ = input.readSInt64();
+                  break;
+                }
+                case 24: {
+                  bitField0_ |= 0x00000004;
+                  top_ = input.readSInt64();
+                  break;
+                }
+                case 32: {
+                  bitField0_ |= 0x00000008;
+                  bottom_ = input.readSInt64();
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
+
+
+    // @@protoc_insertion_point(class_scope:OSMPBF.HeaderBBox)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox DEFAULT_INSTANCE;
+    static {
+      DEFAULT_INSTANCE = new HeaderBBox();
+      DEFAULT_INSTANCE.makeImmutable();
+    }
+
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<HeaderBBox> PARSER;
+
+    public static com.google.protobuf.Parser<HeaderBBox> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
+  }
+
+  public interface PrimitiveBlockOrBuilder extends
+      // @@protoc_insertion_point(interface_extends:OSMPBF.PrimitiveBlock)
+      com.google.protobuf.MessageLiteOrBuilder {
+
+    /**
+     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
+     */
+    boolean hasStringtable();
+    /**
+     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
      */
     org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable getStringtable();
 
@@ -2291,36 +2199,36 @@ public final class Osmformat {
     int getPrimitivegroupCount();
 
     /**
-     * <code>optional int32 granularity = 17 [default = 100];</code>
-     *
      * <pre>
      * Granularity, units of nanodegrees, used to store coordinates in this block
      * </pre>
+     *
+     * <code>optional int32 granularity = 17 [default = 100];</code>
      */
     boolean hasGranularity();
     /**
-     * <code>optional int32 granularity = 17 [default = 100];</code>
-     *
      * <pre>
      * Granularity, units of nanodegrees, used to store coordinates in this block
      * </pre>
+     *
+     * <code>optional int32 granularity = 17 [default = 100];</code>
      */
     int getGranularity();
 
     /**
-     * <code>optional int64 lat_offset = 19 [default = 0];</code>
-     *
      * <pre>
      * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
      * </pre>
+     *
+     * <code>optional int64 lat_offset = 19 [default = 0];</code>
      */
     boolean hasLatOffset();
     /**
-     * <code>optional int64 lat_offset = 19 [default = 0];</code>
-     *
      * <pre>
      * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
      * </pre>
+     *
+     * <code>optional int64 lat_offset = 19 [default = 0];</code>
      */
     long getLatOffset();
 
@@ -2334,149 +2242,35 @@ public final class Osmformat {
     long getLonOffset();
 
     /**
-     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-     *
      * <pre>
      * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
      * </pre>
+     *
+     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
      */
     boolean hasDateGranularity();
     /**
-     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-     *
      * <pre>
      * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
      * </pre>
+     *
+     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
      */
     int getDateGranularity();
   }
   /**
    * Protobuf type {@code OSMPBF.PrimitiveBlock}
    */
-  public static final class PrimitiveBlock extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class PrimitiveBlock extends
+      com.google.protobuf.GeneratedMessageLite<
+          PrimitiveBlock, PrimitiveBlock.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.PrimitiveBlock)
       PrimitiveBlockOrBuilder {
-    // Use PrimitiveBlock.newBuilder() to construct.
-    private PrimitiveBlock(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private PrimitiveBlock(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final PrimitiveBlock defaultInstance;
-    public static PrimitiveBlock getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public PrimitiveBlock getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private PrimitiveBlock(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 10: {
-              org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000001) == 0x00000001)) {
-                subBuilder = stringtable_.toBuilder();
-              }
-              stringtable_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.PARSER, extensionRegistry);
-              if (subBuilder != null) {
-                subBuilder.mergeFrom(stringtable_);
-                stringtable_ = subBuilder.buildPartial();
-              }
-              bitField0_ |= 0x00000001;
-              break;
-            }
-            case 18: {
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                primitivegroup_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              primitivegroup_.add(input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.PARSER, extensionRegistry));
-              break;
-            }
-            case 136: {
-              bitField0_ |= 0x00000002;
-              granularity_ = input.readInt32();
-              break;
-            }
-            case 144: {
-              bitField0_ |= 0x00000010;
-              dateGranularity_ = input.readInt32();
-              break;
-            }
-            case 152: {
-              bitField0_ |= 0x00000004;
-              latOffset_ = input.readInt64();
-              break;
-            }
-            case 160: {
-              bitField0_ |= 0x00000008;
-              lonOffset_ = input.readInt64();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-          primitivegroup_ = java.util.Collections.unmodifiableList(primitivegroup_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<PrimitiveBlock> PARSER =
-        new com.google.protobuf.AbstractParser<PrimitiveBlock>() {
-      public PrimitiveBlock parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new PrimitiveBlock(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<PrimitiveBlock> getParserForType() {
-      return PARSER;
+    private PrimitiveBlock() {
+      primitivegroup_ = emptyProtobufList();
+      granularity_ = 100;
+      dateGranularity_ = 1000;
     }
-
     private int bitField0_;
     public static final int STRINGTABLE_FIELD_NUMBER = 1;
     private org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable stringtable_;
@@ -2490,11 +2284,48 @@ public final class Osmformat {
      * <code>required .OSMPBF.StringTable stringtable = 1;</code>
      */
     public org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable getStringtable() {
-      return stringtable_;
+      return stringtable_ == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance() : stringtable_;
+    }
+    /**
+     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
+     */
+    private void setStringtable(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      stringtable_ = value;
+      bitField0_ |= 0x00000001;
+      }
+    /**
+     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
+     */
+    private void setStringtable(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.Builder builderForValue) {
+      stringtable_ = builderForValue.build();
+      bitField0_ |= 0x00000001;
+    }
+    /**
+     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
+     */
+    private void mergeStringtable(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable value) {
+      if (stringtable_ != null &&
+          stringtable_ != org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance()) {
+        stringtable_ =
+          org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.newBuilder(stringtable_).mergeFrom(value).buildPartial();
+      } else {
+        stringtable_ = value;
+      }
+      bitField0_ |= 0x00000001;
+    }
+    /**
+     * <code>required .OSMPBF.StringTable stringtable = 1;</code>
+     */
+    private void clearStringtable() {  stringtable_ = null;
+      bitField0_ = (bitField0_ & ~0x00000001);
     }
 
     public static final int PRIMITIVEGROUP_FIELD_NUMBER = 2;
-    private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup> primitivegroup_;
+    private com.google.protobuf.Internal.ProtobufList<org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup> primitivegroup_;
     /**
      * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
      */
@@ -2527,52 +2358,181 @@ public final class Osmformat {
         int index) {
       return primitivegroup_.get(index);
     }
+    private void ensurePrimitivegroupIsMutable() {
+      if (!primitivegroup_.isModifiable()) {
+        primitivegroup_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(primitivegroup_);
+       }
+    }
+
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void setPrimitivegroup(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensurePrimitivegroupIsMutable();
+      primitivegroup_.set(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void setPrimitivegroup(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) {
+      ensurePrimitivegroupIsMutable();
+      primitivegroup_.set(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void addPrimitivegroup(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensurePrimitivegroupIsMutable();
+      primitivegroup_.add(value);
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void addPrimitivegroup(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensurePrimitivegroupIsMutable();
+      primitivegroup_.add(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void addPrimitivegroup(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) {
+      ensurePrimitivegroupIsMutable();
+      primitivegroup_.add(builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void addPrimitivegroup(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) {
+      ensurePrimitivegroupIsMutable();
+      primitivegroup_.add(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void addAllPrimitivegroup(
+        java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup> values) {
+      ensurePrimitivegroupIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, primitivegroup_);
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void clearPrimitivegroup() {
+      primitivegroup_ = emptyProtobufList();
+    }
+    /**
+     * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
+     */
+    private void removePrimitivegroup(int index) {
+      ensurePrimitivegroupIsMutable();
+      primitivegroup_.remove(index);
+    }
 
     public static final int GRANULARITY_FIELD_NUMBER = 17;
     private int granularity_;
     /**
-     * <code>optional int32 granularity = 17 [default = 100];</code>
-     *
      * <pre>
      * Granularity, units of nanodegrees, used to store coordinates in this block
      * </pre>
+     *
+     * <code>optional int32 granularity = 17 [default = 100];</code>
      */
     public boolean hasGranularity() {
       return ((bitField0_ & 0x00000002) == 0x00000002);
     }
     /**
-     * <code>optional int32 granularity = 17 [default = 100];</code>
-     *
      * <pre>
      * Granularity, units of nanodegrees, used to store coordinates in this block
      * </pre>
+     *
+     * <code>optional int32 granularity = 17 [default = 100];</code>
      */
     public int getGranularity() {
       return granularity_;
     }
+    /**
+     * <pre>
+     * Granularity, units of nanodegrees, used to store coordinates in this block
+     * </pre>
+     *
+     * <code>optional int32 granularity = 17 [default = 100];</code>
+     */
+    private void setGranularity(int value) {
+      bitField0_ |= 0x00000002;
+      granularity_ = value;
+    }
+    /**
+     * <pre>
+     * Granularity, units of nanodegrees, used to store coordinates in this block
+     * </pre>
+     *
+     * <code>optional int32 granularity = 17 [default = 100];</code>
+     */
+    private void clearGranularity() {
+      bitField0_ = (bitField0_ & ~0x00000002);
+      granularity_ = 100;
+    }
 
     public static final int LAT_OFFSET_FIELD_NUMBER = 19;
     private long latOffset_;
     /**
-     * <code>optional int64 lat_offset = 19 [default = 0];</code>
-     *
      * <pre>
      * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
      * </pre>
+     *
+     * <code>optional int64 lat_offset = 19 [default = 0];</code>
      */
     public boolean hasLatOffset() {
       return ((bitField0_ & 0x00000004) == 0x00000004);
     }
     /**
-     * <code>optional int64 lat_offset = 19 [default = 0];</code>
-     *
      * <pre>
      * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
      * </pre>
+     *
+     * <code>optional int64 lat_offset = 19 [default = 0];</code>
      */
     public long getLatOffset() {
       return latOffset_;
     }
+    /**
+     * <pre>
+     * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
+     * </pre>
+     *
+     * <code>optional int64 lat_offset = 19 [default = 0];</code>
+     */
+    private void setLatOffset(long value) {
+      bitField0_ |= 0x00000004;
+      latOffset_ = value;
+    }
+    /**
+     * <pre>
+     * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
+     * </pre>
+     *
+     * <code>optional int64 lat_offset = 19 [default = 0];</code>
+     */
+    private void clearLatOffset() {
+      bitField0_ = (bitField0_ & ~0x00000004);
+      latOffset_ = 0L;
+    }
 
     public static final int LON_OFFSET_FIELD_NUMBER = 20;
     private long lonOffset_;
@@ -2588,63 +2548,70 @@ public final class Osmformat {
     public long getLonOffset() {
       return lonOffset_;
     }
+    /**
+     * <code>optional int64 lon_offset = 20 [default = 0];</code>
+     */
+    private void setLonOffset(long value) {
+      bitField0_ |= 0x00000008;
+      lonOffset_ = value;
+    }
+    /**
+     * <code>optional int64 lon_offset = 20 [default = 0];</code>
+     */
+    private void clearLonOffset() {
+      bitField0_ = (bitField0_ & ~0x00000008);
+      lonOffset_ = 0L;
+    }
 
     public static final int DATE_GRANULARITY_FIELD_NUMBER = 18;
     private int dateGranularity_;
     /**
-     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-     *
      * <pre>
      * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
      * </pre>
+     *
+     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
      */
     public boolean hasDateGranularity() {
       return ((bitField0_ & 0x00000010) == 0x00000010);
     }
     /**
-     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-     *
      * <pre>
      * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
      * </pre>
+     *
+     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
      */
     public int getDateGranularity() {
       return dateGranularity_;
     }
-
-    private void initFields() {
-      stringtable_ = org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance();
-      primitivegroup_ = java.util.Collections.emptyList();
-      granularity_ = 100;
-      latOffset_ = 0L;
-      lonOffset_ = 0L;
+    /**
+     * <pre>
+     * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
+     * </pre>
+     *
+     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
+     */
+    private void setDateGranularity(int value) {
+      bitField0_ |= 0x00000010;
+      dateGranularity_ = value;
+    }
+    /**
+     * <pre>
+     * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
+     * </pre>
+     *
+     * <code>optional int32 date_granularity = 18 [default = 1000];</code>
+     */
+    private void clearDateGranularity() {
+      bitField0_ = (bitField0_ & ~0x00000010);
       dateGranularity_ = 1000;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
 
-      if (!hasStringtable()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      for (int i = 0; i < getPrimitivegroupCount(); i++) {
-        if (!getPrimitivegroup(i).isInitialized()) {
-          memoizedIsInitialized = 0;
-          return false;
-        }
-      }
-      memoizedIsInitialized = 1;
-      return true;
-    }
-
-    public void writeTo(com.google.protobuf.CodedOutputStream output)
-                        throws java.io.IOException {
-      getSerializedSize();
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeMessage(1, stringtable_);
+    public void writeTo(com.google.protobuf.CodedOutputStream output)
+                        throws java.io.IOException {
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeMessage(1, getStringtable());
       }
       for (int i = 0; i < primitivegroup_.size(); i++) {
         output.writeMessage(2, primitivegroup_.get(i));
@@ -2661,10 +2628,9 @@ public final class Osmformat {
       if (((bitField0_ & 0x00000008) == 0x00000008)) {
         output.writeInt64(20, lonOffset_);
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -2672,7 +2638,7 @@ public final class Osmformat {
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(1, stringtable_);
+          .computeMessageSize(1, getStringtable());
       }
       for (int i = 0; i < primitivegroup_.size(); i++) {
         size += com.google.protobuf.CodedOutputStream
@@ -2694,327 +2660,163 @@ public final class Osmformat {
         size += com.google.protobuf.CodedOutputStream
           .computeInt64Size(20, lonOffset_);
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.PrimitiveBlock}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.PrimitiveBlock)
         org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlockOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        stringtable_ = org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        primitivegroup_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        granularity_ = 100;
-        bitField0_ = (bitField0_ & ~0x00000004);
-        latOffset_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000008);
-        lonOffset_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000010);
-        dateGranularity_ = 1000;
-        bitField0_ = (bitField0_ & ~0x00000020);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock result = new org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.stringtable_ = stringtable_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          primitivegroup_ = java.util.Collections.unmodifiableList(primitivegroup_);
-          bitField0_ = (bitField0_ & ~0x00000002);
-        }
-        result.primitivegroup_ = primitivegroup_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.granularity_ = granularity_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000004;
-        }
-        result.latOffset_ = latOffset_;
-        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
-          to_bitField0_ |= 0x00000008;
-        }
-        result.lonOffset_ = lonOffset_;
-        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
-          to_bitField0_ |= 0x00000010;
-        }
-        result.dateGranularity_ = dateGranularity_;
-        result.bitField0_ = to_bitField0_;
-        return result;
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock.getDefaultInstance()) return this;
-        if (other.hasStringtable()) {
-          mergeStringtable(other.getStringtable());
-        }
-        if (!other.primitivegroup_.isEmpty()) {
-          if (primitivegroup_.isEmpty()) {
-            primitivegroup_ = other.primitivegroup_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensurePrimitivegroupIsMutable();
-            primitivegroup_.addAll(other.primitivegroup_);
-          }
-          
-        }
-        if (other.hasGranularity()) {
-          setGranularity(other.getGranularity());
-        }
-        if (other.hasLatOffset()) {
-          setLatOffset(other.getLatOffset());
-        }
-        if (other.hasLonOffset()) {
-          setLonOffset(other.getLonOffset());
-        }
-        if (other.hasDateGranularity()) {
-          setDateGranularity(other.getDateGranularity());
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        if (!hasStringtable()) {
-          
-          return false;
-        }
-        for (int i = 0; i < getPrimitivegroupCount(); i++) {
-          if (!getPrimitivegroup(i).isInitialized()) {
-            
-            return false;
-          }
-        }
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable stringtable_ = org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance();
       /**
        * <code>required .OSMPBF.StringTable stringtable = 1;</code>
        */
       public boolean hasStringtable() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasStringtable();
       }
       /**
        * <code>required .OSMPBF.StringTable stringtable = 1;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable getStringtable() {
-        return stringtable_;
+        return instance.getStringtable();
       }
       /**
        * <code>required .OSMPBF.StringTable stringtable = 1;</code>
        */
       public Builder setStringtable(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        stringtable_ = value;
-
-        bitField0_ |= 0x00000001;
+        copyOnWrite();
+        instance.setStringtable(value);
         return this;
-      }
+        }
       /**
        * <code>required .OSMPBF.StringTable stringtable = 1;</code>
        */
       public Builder setStringtable(
           org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.Builder builderForValue) {
-        stringtable_ = builderForValue.build();
-
-        bitField0_ |= 0x00000001;
+        copyOnWrite();
+        instance.setStringtable(builderForValue);
         return this;
       }
       /**
        * <code>required .OSMPBF.StringTable stringtable = 1;</code>
        */
       public Builder mergeStringtable(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable value) {
-        if (((bitField0_ & 0x00000001) == 0x00000001) &&
-            stringtable_ != org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance()) {
-          stringtable_ =
-            org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.newBuilder(stringtable_).mergeFrom(value).buildPartial();
-        } else {
-          stringtable_ = value;
-        }
-
-        bitField0_ |= 0x00000001;
+        copyOnWrite();
+        instance.mergeStringtable(value);
         return this;
       }
       /**
        * <code>required .OSMPBF.StringTable stringtable = 1;</code>
        */
-      public Builder clearStringtable() {
-        stringtable_ = org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance();
-
-        bitField0_ = (bitField0_ & ~0x00000001);
+      public Builder clearStringtable() {  copyOnWrite();
+        instance.clearStringtable();
         return this;
       }
 
-      private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup> primitivegroup_ =
-        java.util.Collections.emptyList();
-      private void ensurePrimitivegroupIsMutable() {
-        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          primitivegroup_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup>(primitivegroup_);
-          bitField0_ |= 0x00000002;
-         }
-      }
-
       /**
        * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
        */
       public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup> getPrimitivegroupList() {
-        return java.util.Collections.unmodifiableList(primitivegroup_);
+        return java.util.Collections.unmodifiableList(
+            instance.getPrimitivegroupList());
       }
       /**
        * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
        */
       public int getPrimitivegroupCount() {
-        return primitivegroup_.size();
-      }
-      /**
+        return instance.getPrimitivegroupCount();
+      }/**
        * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup getPrimitivegroup(int index) {
-        return primitivegroup_.get(index);
+        return instance.getPrimitivegroup(index);
       }
       /**
        * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
        */
       public Builder setPrimitivegroup(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensurePrimitivegroupIsMutable();
-        primitivegroup_.set(index, value);
-
+        copyOnWrite();
+        instance.setPrimitivegroup(index, value);
         return this;
       }
       /**
@@ -3022,21 +2824,16 @@ public final class Osmformat {
        */
       public Builder setPrimitivegroup(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) {
-        ensurePrimitivegroupIsMutable();
-        primitivegroup_.set(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.setPrimitivegroup(index, builderForValue);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
        */
       public Builder addPrimitivegroup(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensurePrimitivegroupIsMutable();
-        primitivegroup_.add(value);
-
+        copyOnWrite();
+        instance.addPrimitivegroup(value);
         return this;
       }
       /**
@@ -3044,12 +2841,8 @@ public final class Osmformat {
        */
       public Builder addPrimitivegroup(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensurePrimitivegroupIsMutable();
-        primitivegroup_.add(index, value);
-
+        copyOnWrite();
+        instance.addPrimitivegroup(index, value);
         return this;
       }
       /**
@@ -3057,9 +2850,8 @@ public final class Osmformat {
        */
       public Builder addPrimitivegroup(
           org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) {
-        ensurePrimitivegroupIsMutable();
-        primitivegroup_.add(builderForValue.build());
-
+        copyOnWrite();
+        instance.addPrimitivegroup(builderForValue);
         return this;
       }
       /**
@@ -3067,9 +2859,8 @@ public final class Osmformat {
        */
       public Builder addPrimitivegroup(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) {
-        ensurePrimitivegroupIsMutable();
-        primitivegroup_.add(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.addPrimitivegroup(index, builderForValue);
         return this;
       }
       /**
@@ -3077,216 +2868,360 @@ public final class Osmformat {
        */
       public Builder addAllPrimitivegroup(
           java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup> values) {
-        ensurePrimitivegroupIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, primitivegroup_);
-
+        copyOnWrite();
+        instance.addAllPrimitivegroup(values);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
        */
       public Builder clearPrimitivegroup() {
-        primitivegroup_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-
+        copyOnWrite();
+        instance.clearPrimitivegroup();
         return this;
       }
       /**
        * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code>
        */
       public Builder removePrimitivegroup(int index) {
-        ensurePrimitivegroupIsMutable();
-        primitivegroup_.remove(index);
-
+        copyOnWrite();
+        instance.removePrimitivegroup(index);
         return this;
       }
 
-      private int granularity_ = 100;
       /**
-       * <code>optional int32 granularity = 17 [default = 100];</code>
-       *
        * <pre>
        * Granularity, units of nanodegrees, used to store coordinates in this block
        * </pre>
+       *
+       * <code>optional int32 granularity = 17 [default = 100];</code>
        */
       public boolean hasGranularity() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
+        return instance.hasGranularity();
       }
       /**
-       * <code>optional int32 granularity = 17 [default = 100];</code>
-       *
        * <pre>
        * Granularity, units of nanodegrees, used to store coordinates in this block
        * </pre>
+       *
+       * <code>optional int32 granularity = 17 [default = 100];</code>
        */
       public int getGranularity() {
-        return granularity_;
+        return instance.getGranularity();
       }
       /**
-       * <code>optional int32 granularity = 17 [default = 100];</code>
-       *
        * <pre>
        * Granularity, units of nanodegrees, used to store coordinates in this block
        * </pre>
+       *
+       * <code>optional int32 granularity = 17 [default = 100];</code>
        */
       public Builder setGranularity(int value) {
-        bitField0_ |= 0x00000004;
-        granularity_ = value;
-        
+        copyOnWrite();
+        instance.setGranularity(value);
         return this;
       }
       /**
-       * <code>optional int32 granularity = 17 [default = 100];</code>
-       *
        * <pre>
        * Granularity, units of nanodegrees, used to store coordinates in this block
        * </pre>
+       *
+       * <code>optional int32 granularity = 17 [default = 100];</code>
        */
       public Builder clearGranularity() {
-        bitField0_ = (bitField0_ & ~0x00000004);
-        granularity_ = 100;
-        
+        copyOnWrite();
+        instance.clearGranularity();
         return this;
       }
 
-      private long latOffset_ ;
       /**
-       * <code>optional int64 lat_offset = 19 [default = 0];</code>
-       *
        * <pre>
        * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
        * </pre>
+       *
+       * <code>optional int64 lat_offset = 19 [default = 0];</code>
        */
       public boolean hasLatOffset() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasLatOffset();
       }
       /**
-       * <code>optional int64 lat_offset = 19 [default = 0];</code>
-       *
        * <pre>
        * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
        * </pre>
+       *
+       * <code>optional int64 lat_offset = 19 [default = 0];</code>
        */
       public long getLatOffset() {
-        return latOffset_;
+        return instance.getLatOffset();
       }
       /**
-       * <code>optional int64 lat_offset = 19 [default = 0];</code>
-       *
        * <pre>
        * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
        * </pre>
+       *
+       * <code>optional int64 lat_offset = 19 [default = 0];</code>
        */
       public Builder setLatOffset(long value) {
-        bitField0_ |= 0x00000008;
-        latOffset_ = value;
-        
+        copyOnWrite();
+        instance.setLatOffset(value);
         return this;
       }
       /**
-       * <code>optional int64 lat_offset = 19 [default = 0];</code>
-       *
        * <pre>
        * Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
        * </pre>
+       *
+       * <code>optional int64 lat_offset = 19 [default = 0];</code>
        */
       public Builder clearLatOffset() {
-        bitField0_ = (bitField0_ & ~0x00000008);
-        latOffset_ = 0L;
-        
+        copyOnWrite();
+        instance.clearLatOffset();
         return this;
       }
 
-      private long lonOffset_ ;
       /**
        * <code>optional int64 lon_offset = 20 [default = 0];</code>
        */
       public boolean hasLonOffset() {
-        return ((bitField0_ & 0x00000010) == 0x00000010);
+        return instance.hasLonOffset();
       }
       /**
        * <code>optional int64 lon_offset = 20 [default = 0];</code>
        */
       public long getLonOffset() {
-        return lonOffset_;
+        return instance.getLonOffset();
       }
       /**
        * <code>optional int64 lon_offset = 20 [default = 0];</code>
        */
       public Builder setLonOffset(long value) {
-        bitField0_ |= 0x00000010;
-        lonOffset_ = value;
-        
+        copyOnWrite();
+        instance.setLonOffset(value);
         return this;
       }
       /**
        * <code>optional int64 lon_offset = 20 [default = 0];</code>
        */
       public Builder clearLonOffset() {
-        bitField0_ = (bitField0_ & ~0x00000010);
-        lonOffset_ = 0L;
-        
+        copyOnWrite();
+        instance.clearLonOffset();
         return this;
       }
 
-      private int dateGranularity_ = 1000;
       /**
-       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-       *
        * <pre>
        * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
        * </pre>
+       *
+       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
        */
       public boolean hasDateGranularity() {
-        return ((bitField0_ & 0x00000020) == 0x00000020);
+        return instance.hasDateGranularity();
       }
       /**
-       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-       *
        * <pre>
        * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
        * </pre>
+       *
+       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
        */
       public int getDateGranularity() {
-        return dateGranularity_;
+        return instance.getDateGranularity();
       }
       /**
-       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-       *
        * <pre>
        * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
        * </pre>
+       *
+       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
        */
       public Builder setDateGranularity(int value) {
-        bitField0_ |= 0x00000020;
-        dateGranularity_ = value;
-        
+        copyOnWrite();
+        instance.setDateGranularity(value);
         return this;
       }
       /**
-       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
-       *
        * <pre>
        * Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
        * </pre>
+       *
+       * <code>optional int32 date_granularity = 18 [default = 1000];</code>
        */
       public Builder clearDateGranularity() {
-        bitField0_ = (bitField0_ & ~0x00000020);
-        dateGranularity_ = 1000;
-        
+        copyOnWrite();
+        instance.clearDateGranularity();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.PrimitiveBlock)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (!hasStringtable()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          for (int i = 0; i < getPrimitivegroupCount(); i++) {
+            if (!getPrimitivegroup(i).isInitialized()) {
+              if (shouldMemoize) {
+                memoizedIsInitialized = 0;
+              }
+              return null;
+            }
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
+
+        }
+        case MAKE_IMMUTABLE: {
+          primitivegroup_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock other = (org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock) arg1;
+          stringtable_ = visitor.visitMessage(stringtable_, other.stringtable_);
+          primitivegroup_= visitor.visitList(primitivegroup_, other.primitivegroup_);
+          granularity_ = visitor.visitInt(
+              hasGranularity(), granularity_,
+              other.hasGranularity(), other.granularity_);
+          latOffset_ = visitor.visitLong(
+              hasLatOffset(), latOffset_,
+              other.hasLatOffset(), other.latOffset_);
+          lonOffset_ = visitor.visitLong(
+              hasLonOffset(), lonOffset_,
+              other.hasLonOffset(), other.lonOffset_);
+          dateGranularity_ = visitor.visitInt(
+              hasDateGranularity(), dateGranularity_,
+              other.hasDateGranularity(), other.dateGranularity_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 10: {
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.Builder subBuilder = null;
+                  if (((bitField0_ & 0x00000001) == 0x00000001)) {
+                    subBuilder = stringtable_.toBuilder();
+                  }
+                  stringtable_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.parser(), extensionRegistry);
+                  if (subBuilder != null) {
+                    subBuilder.mergeFrom(stringtable_);
+                    stringtable_ = subBuilder.buildPartial();
+                  }
+                  bitField0_ |= 0x00000001;
+                  break;
+                }
+                case 18: {
+                  if (!primitivegroup_.isModifiable()) {
+                    primitivegroup_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(primitivegroup_);
+                  }
+                  primitivegroup_.add(
+                      input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.parser(), extensionRegistry));
+                  break;
+                }
+                case 136: {
+                  bitField0_ |= 0x00000002;
+                  granularity_ = input.readInt32();
+                  break;
+                }
+                case 144: {
+                  bitField0_ |= 0x00000010;
+                  dateGranularity_ = input.readInt32();
+                  break;
+                }
+                case 152: {
+                  bitField0_ |= 0x00000004;
+                  latOffset_ = input.readInt64();
+                  break;
+                }
+                case 160: {
+                  bitField0_ |= 0x00000008;
+                  lonOffset_ = input.readInt64();
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
+
 
+    // @@protoc_insertion_point(class_scope:OSMPBF.PrimitiveBlock)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock DEFAULT_INSTANCE;
     static {
-      defaultInstance = new PrimitiveBlock(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new PrimitiveBlock();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.PrimitiveBlock)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveBlock getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<PrimitiveBlock> PARSER;
+
+    public static com.google.protobuf.Parser<PrimitiveBlock> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface PrimitiveGroupOrBuilder extends
@@ -3359,152 +3294,26 @@ public final class Osmformat {
     int getChangesetsCount();
   }
   /**
-   * Protobuf type {@code OSMPBF.PrimitiveGroup}
-   *
    * <pre>
    * Group of OSMPrimitives. All primitives in a group must be the same type.
    * </pre>
+   *
+   * Protobuf type {@code OSMPBF.PrimitiveGroup}
    */
-  public static final class PrimitiveGroup extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class PrimitiveGroup extends
+      com.google.protobuf.GeneratedMessageLite<
+          PrimitiveGroup, PrimitiveGroup.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.PrimitiveGroup)
       PrimitiveGroupOrBuilder {
-    // Use PrimitiveGroup.newBuilder() to construct.
-    private PrimitiveGroup(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private PrimitiveGroup(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final PrimitiveGroup defaultInstance;
-    public static PrimitiveGroup getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public PrimitiveGroup getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private PrimitiveGroup(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 10: {
-              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-                nodes_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Node>();
-                mutable_bitField0_ |= 0x00000001;
-              }
-              nodes_.add(input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Node.PARSER, extensionRegistry));
-              break;
-            }
-            case 18: {
-              org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000001) == 0x00000001)) {
-                subBuilder = dense_.toBuilder();
-              }
-              dense_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.PARSER, extensionRegistry);
-              if (subBuilder != null) {
-                subBuilder.mergeFrom(dense_);
-                dense_ = subBuilder.buildPartial();
-              }
-              bitField0_ |= 0x00000001;
-              break;
-            }
-            case 26: {
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                ways_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Way>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              ways_.add(input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Way.PARSER, extensionRegistry));
-              break;
-            }
-            case 34: {
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-                relations_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              relations_.add(input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.PARSER, extensionRegistry));
-              break;
-            }
-            case 42: {
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-                changesets_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              changesets_.add(input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.PARSER, extensionRegistry));
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-          nodes_ = java.util.Collections.unmodifiableList(nodes_);
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          ways_ = java.util.Collections.unmodifiableList(ways_);
-        }
-        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-          relations_ = java.util.Collections.unmodifiableList(relations_);
-        }
-        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-          changesets_ = java.util.Collections.unmodifiableList(changesets_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
+    private PrimitiveGroup() {
+      nodes_ = emptyProtobufList();
+      ways_ = emptyProtobufList();
+      relations_ = emptyProtobufList();
+      changesets_ = emptyProtobufList();
     }
-    public static com.google.protobuf.Parser<PrimitiveGroup> PARSER =
-        new com.google.protobuf.AbstractParser<PrimitiveGroup>() {
-      public PrimitiveGroup parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new PrimitiveGroup(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<PrimitiveGroup> getParserForType() {
-      return PARSER;
-    }
-
     private int bitField0_;
     public static final int NODES_FIELD_NUMBER = 1;
-    private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Node> nodes_;
+    private com.google.protobuf.Internal.ProtobufList<org.openstreetmap.osmosis.osmbinary.Osmformat.Node> nodes_;
     /**
      * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
@@ -3537,82 +3346,289 @@ public final class Osmformat {
         int index) {
       return nodes_.get(index);
     }
+    private void ensureNodesIsMutable() {
+      if (!nodes_.isModifiable()) {
+        nodes_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(nodes_);
+       }
+    }
 
-    public static final int DENSE_FIELD_NUMBER = 2;
-    private org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes dense_;
     /**
-     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public boolean hasDense() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
+    private void setNodes(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureNodesIsMutable();
+      nodes_.set(index, value);
     }
     /**
-     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes getDense() {
-      return dense_;
+    private void setNodes(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node.Builder builderForValue) {
+      ensureNodesIsMutable();
+      nodes_.set(index, builderForValue.build());
     }
-
-    public static final int WAYS_FIELD_NUMBER = 3;
-    private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Way> ways_;
     /**
-     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Way> getWaysList() {
-      return ways_;
+    private void addNodes(org.openstreetmap.osmosis.osmbinary.Osmformat.Node value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureNodesIsMutable();
+      nodes_.add(value);
     }
     /**
-     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public java.util.List<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.WayOrBuilder> 
-        getWaysOrBuilderList() {
-      return ways_;
+    private void addNodes(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureNodesIsMutable();
+      nodes_.add(index, value);
     }
     /**
-     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public int getWaysCount() {
-      return ways_.size();
+    private void addNodes(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.Node.Builder builderForValue) {
+      ensureNodesIsMutable();
+      nodes_.add(builderForValue.build());
     }
     /**
-     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public org.openstreetmap.osmosis.osmbinary.Osmformat.Way getWays(int index) {
-      return ways_.get(index);
+    private void addNodes(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node.Builder builderForValue) {
+      ensureNodesIsMutable();
+      nodes_.add(index, builderForValue.build());
     }
     /**
-     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public org.openstreetmap.osmosis.osmbinary.Osmformat.WayOrBuilder getWaysOrBuilder(
-        int index) {
-      return ways_.get(index);
+    private void addAllNodes(
+        java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Node> values) {
+      ensureNodesIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, nodes_);
     }
-
-    public static final int RELATIONS_FIELD_NUMBER = 4;
-    private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> relations_;
     /**
-     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> getRelationsList() {
-      return relations_;
+    private void clearNodes() {
+      nodes_ = emptyProtobufList();
     }
     /**
-     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     * <code>repeated .OSMPBF.Node nodes = 1;</code>
      */
-    public java.util.List<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.RelationOrBuilder> 
-        getRelationsOrBuilderList() {
-      return relations_;
+    private void removeNodes(int index) {
+      ensureNodesIsMutable();
+      nodes_.remove(index);
     }
+
+    public static final int DENSE_FIELD_NUMBER = 2;
+    private org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes dense_;
     /**
-     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
      */
-    public int getRelationsCount() {
-      return relations_.size();
+    public boolean hasDense() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
-     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
      */
-    public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation getRelations(int index) {
+    public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes getDense() {
+      return dense_ == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance() : dense_;
+    }
+    /**
+     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
+     */
+    private void setDense(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      dense_ = value;
+      bitField0_ |= 0x00000001;
+      }
+    /**
+     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
+     */
+    private void setDense(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.Builder builderForValue) {
+      dense_ = builderForValue.build();
+      bitField0_ |= 0x00000001;
+    }
+    /**
+     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
+     */
+    private void mergeDense(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes value) {
+      if (dense_ != null &&
+          dense_ != org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance()) {
+        dense_ =
+          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.newBuilder(dense_).mergeFrom(value).buildPartial();
+      } else {
+        dense_ = value;
+      }
+      bitField0_ |= 0x00000001;
+    }
+    /**
+     * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
+     */
+    private void clearDense() {  dense_ = null;
+      bitField0_ = (bitField0_ & ~0x00000001);
+    }
+
+    public static final int WAYS_FIELD_NUMBER = 3;
+    private com.google.protobuf.Internal.ProtobufList<org.openstreetmap.osmosis.osmbinary.Osmformat.Way> ways_;
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Way> getWaysList() {
+      return ways_;
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    public java.util.List<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.WayOrBuilder> 
+        getWaysOrBuilderList() {
+      return ways_;
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    public int getWaysCount() {
+      return ways_.size();
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    public org.openstreetmap.osmosis.osmbinary.Osmformat.Way getWays(int index) {
+      return ways_.get(index);
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    public org.openstreetmap.osmosis.osmbinary.Osmformat.WayOrBuilder getWaysOrBuilder(
+        int index) {
+      return ways_.get(index);
+    }
+    private void ensureWaysIsMutable() {
+      if (!ways_.isModifiable()) {
+        ways_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(ways_);
+       }
+    }
+
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void setWays(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureWaysIsMutable();
+      ways_.set(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void setWays(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way.Builder builderForValue) {
+      ensureWaysIsMutable();
+      ways_.set(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void addWays(org.openstreetmap.osmosis.osmbinary.Osmformat.Way value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureWaysIsMutable();
+      ways_.add(value);
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void addWays(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureWaysIsMutable();
+      ways_.add(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void addWays(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.Way.Builder builderForValue) {
+      ensureWaysIsMutable();
+      ways_.add(builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void addWays(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way.Builder builderForValue) {
+      ensureWaysIsMutable();
+      ways_.add(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void addAllWays(
+        java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Way> values) {
+      ensureWaysIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, ways_);
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void clearWays() {
+      ways_ = emptyProtobufList();
+    }
+    /**
+     * <code>repeated .OSMPBF.Way ways = 3;</code>
+     */
+    private void removeWays(int index) {
+      ensureWaysIsMutable();
+      ways_.remove(index);
+    }
+
+    public static final int RELATIONS_FIELD_NUMBER = 4;
+    private com.google.protobuf.Internal.ProtobufList<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> relations_;
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> getRelationsList() {
+      return relations_;
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    public java.util.List<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.RelationOrBuilder> 
+        getRelationsOrBuilderList() {
+      return relations_;
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    public int getRelationsCount() {
+      return relations_.size();
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation getRelations(int index) {
       return relations_.get(index);
     }
     /**
@@ -3622,9 +3638,94 @@ public final class Osmformat {
         int index) {
       return relations_.get(index);
     }
+    private void ensureRelationsIsMutable() {
+      if (!relations_.isModifiable()) {
+        relations_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(relations_);
+       }
+    }
+
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void setRelations(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureRelationsIsMutable();
+      relations_.set(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void setRelations(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.Builder builderForValue) {
+      ensureRelationsIsMutable();
+      relations_.set(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void addRelations(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureRelationsIsMutable();
+      relations_.add(value);
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void addRelations(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureRelationsIsMutable();
+      relations_.add(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void addRelations(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.Builder builderForValue) {
+      ensureRelationsIsMutable();
+      relations_.add(builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void addRelations(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.Builder builderForValue) {
+      ensureRelationsIsMutable();
+      relations_.add(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void addAllRelations(
+        java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> values) {
+      ensureRelationsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, relations_);
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void clearRelations() {
+      relations_ = emptyProtobufList();
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation relations = 4;</code>
+     */
+    private void removeRelations(int index) {
+      ensureRelationsIsMutable();
+      relations_.remove(index);
+    }
 
     public static final int CHANGESETS_FIELD_NUMBER = 5;
-    private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet> changesets_;
+    private com.google.protobuf.Internal.ProtobufList<org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet> changesets_;
     /**
      * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
      */
@@ -3657,56 +3758,99 @@ public final class Osmformat {
         int index) {
       return changesets_.get(index);
     }
-
-    private void initFields() {
-      nodes_ = java.util.Collections.emptyList();
-      dense_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance();
-      ways_ = java.util.Collections.emptyList();
-      relations_ = java.util.Collections.emptyList();
-      changesets_ = java.util.Collections.emptyList();
+    private void ensureChangesetsIsMutable() {
+      if (!changesets_.isModifiable()) {
+        changesets_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(changesets_);
+       }
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
 
-      for (int i = 0; i < getNodesCount(); i++) {
-        if (!getNodes(i).isInitialized()) {
-          memoizedIsInitialized = 0;
-          return false;
-        }
-      }
-      for (int i = 0; i < getWaysCount(); i++) {
-        if (!getWays(i).isInitialized()) {
-          memoizedIsInitialized = 0;
-          return false;
-        }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void setChangesets(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      for (int i = 0; i < getRelationsCount(); i++) {
-        if (!getRelations(i).isInitialized()) {
-          memoizedIsInitialized = 0;
-          return false;
-        }
+      ensureChangesetsIsMutable();
+      changesets_.set(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void setChangesets(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.Builder builderForValue) {
+      ensureChangesetsIsMutable();
+      changesets_.set(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void addChangesets(org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      for (int i = 0; i < getChangesetsCount(); i++) {
-        if (!getChangesets(i).isInitialized()) {
-          memoizedIsInitialized = 0;
-          return false;
-        }
+      ensureChangesetsIsMutable();
+      changesets_.add(value);
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void addChangesets(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      memoizedIsInitialized = 1;
-      return true;
+      ensureChangesetsIsMutable();
+      changesets_.add(index, value);
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void addChangesets(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.Builder builderForValue) {
+      ensureChangesetsIsMutable();
+      changesets_.add(builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void addChangesets(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.Builder builderForValue) {
+      ensureChangesetsIsMutable();
+      changesets_.add(index, builderForValue.build());
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void addAllChangesets(
+        java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet> values) {
+      ensureChangesetsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, changesets_);
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void clearChangesets() {
+      changesets_ = emptyProtobufList();
+    }
+    /**
+     * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
+     */
+    private void removeChangesets(int index) {
+      ensureChangesetsIsMutable();
+      changesets_.remove(index);
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       for (int i = 0; i < nodes_.size(); i++) {
         output.writeMessage(1, nodes_.get(i));
       }
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeMessage(2, dense_);
+        output.writeMessage(2, getDense());
       }
       for (int i = 0; i < ways_.size(); i++) {
         output.writeMessage(3, ways_.get(i));
@@ -3717,10 +3861,9 @@ public final class Osmformat {
       for (int i = 0; i < changesets_.size(); i++) {
         output.writeMessage(5, changesets_.get(i));
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -3732,7 +3875,7 @@ public final class Osmformat {
       }
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(2, dense_);
+          .computeMessageSize(2, getDense());
       }
       for (int i = 0; i < ways_.size(); i++) {
         size += com.google.protobuf.CodedOutputStream
@@ -3746,300 +3889,122 @@ public final class Osmformat {
         size += com.google.protobuf.CodedOutputStream
           .computeMessageSize(5, changesets_.get(i));
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
-     * Protobuf type {@code OSMPBF.PrimitiveGroup}
-     *
      * <pre>
      * Group of OSMPrimitives. All primitives in a group must be the same type.
      * </pre>
+     *
+     * Protobuf type {@code OSMPBF.PrimitiveGroup}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.PrimitiveGroup)
         org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroupOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder clear() {
-        super.clear();
-        nodes_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        dense_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        ways_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        relations_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        changesets_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup result = new org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((bitField0_ & 0x00000001) == 0x00000001)) {
-          nodes_ = java.util.Collections.unmodifiableList(nodes_);
-          bitField0_ = (bitField0_ & ~0x00000001);
-        }
-        result.nodes_ = nodes_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.dense_ = dense_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          ways_ = java.util.Collections.unmodifiableList(ways_);
-          bitField0_ = (bitField0_ & ~0x00000004);
-        }
-        result.ways_ = ways_;
-        if (((bitField0_ & 0x00000008) == 0x00000008)) {
-          relations_ = java.util.Collections.unmodifiableList(relations_);
-          bitField0_ = (bitField0_ & ~0x00000008);
-        }
-        result.relations_ = relations_;
-        if (((bitField0_ & 0x00000010) == 0x00000010)) {
-          changesets_ = java.util.Collections.unmodifiableList(changesets_);
-          bitField0_ = (bitField0_ & ~0x00000010);
-        }
-        result.changesets_ = changesets_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.getDefaultInstance()) return this;
-        if (!other.nodes_.isEmpty()) {
-          if (nodes_.isEmpty()) {
-            nodes_ = other.nodes_;
-            bitField0_ = (bitField0_ & ~0x00000001);
-          } else {
-            ensureNodesIsMutable();
-            nodes_.addAll(other.nodes_);
-          }
-          
-        }
-        if (other.hasDense()) {
-          mergeDense(other.getDense());
-        }
-        if (!other.ways_.isEmpty()) {
-          if (ways_.isEmpty()) {
-            ways_ = other.ways_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureWaysIsMutable();
-            ways_.addAll(other.ways_);
-          }
-          
-        }
-        if (!other.relations_.isEmpty()) {
-          if (relations_.isEmpty()) {
-            relations_ = other.relations_;
-            bitField0_ = (bitField0_ & ~0x00000008);
-          } else {
-            ensureRelationsIsMutable();
-            relations_.addAll(other.relations_);
-          }
-          
-        }
-        if (!other.changesets_.isEmpty()) {
-          if (changesets_.isEmpty()) {
-            changesets_ = other.changesets_;
-            bitField0_ = (bitField0_ & ~0x00000010);
-          } else {
-            ensureChangesetsIsMutable();
-            changesets_.addAll(other.changesets_);
-          }
-          
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        for (int i = 0; i < getNodesCount(); i++) {
-          if (!getNodes(i).isInitialized()) {
-            
-            return false;
-          }
-        }
-        for (int i = 0; i < getWaysCount(); i++) {
-          if (!getWays(i).isInitialized()) {
-            
-            return false;
-          }
-        }
-        for (int i = 0; i < getRelationsCount(); i++) {
-          if (!getRelations(i).isInitialized()) {
-            
-            return false;
-          }
-        }
-        for (int i = 0; i < getChangesetsCount(); i++) {
-          if (!getChangesets(i).isInitialized()) {
-            
-            return false;
-          }
-        }
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
-
-      private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Node> nodes_ =
-        java.util.Collections.emptyList();
-      private void ensureNodesIsMutable() {
-        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
-          nodes_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Node>(nodes_);
-          bitField0_ |= 0x00000001;
-         }
-      }
 
       /**
        * <code>repeated .OSMPBF.Node nodes = 1;</code>
        */
       public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Node> getNodesList() {
-        return java.util.Collections.unmodifiableList(nodes_);
+        return java.util.Collections.unmodifiableList(
+            instance.getNodesList());
       }
       /**
        * <code>repeated .OSMPBF.Node nodes = 1;</code>
        */
       public int getNodesCount() {
-        return nodes_.size();
-      }
-      /**
+        return instance.getNodesCount();
+      }/**
        * <code>repeated .OSMPBF.Node nodes = 1;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.Node getNodes(int index) {
-        return nodes_.get(index);
+        return instance.getNodes(index);
       }
       /**
        * <code>repeated .OSMPBF.Node nodes = 1;</code>
        */
       public Builder setNodes(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureNodesIsMutable();
-        nodes_.set(index, value);
-
+        copyOnWrite();
+        instance.setNodes(index, value);
         return this;
       }
       /**
@@ -4047,21 +4012,16 @@ public final class Osmformat {
        */
       public Builder setNodes(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node.Builder builderForValue) {
-        ensureNodesIsMutable();
-        nodes_.set(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.setNodes(index, builderForValue);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Node nodes = 1;</code>
        */
       public Builder addNodes(org.openstreetmap.osmosis.osmbinary.Osmformat.Node value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureNodesIsMutable();
-        nodes_.add(value);
-
+        copyOnWrite();
+        instance.addNodes(value);
         return this;
       }
       /**
@@ -4069,12 +4029,8 @@ public final class Osmformat {
        */
       public Builder addNodes(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureNodesIsMutable();
-        nodes_.add(index, value);
-
+        copyOnWrite();
+        instance.addNodes(index, value);
         return this;
       }
       /**
@@ -4082,9 +4038,8 @@ public final class Osmformat {
        */
       public Builder addNodes(
           org.openstreetmap.osmosis.osmbinary.Osmformat.Node.Builder builderForValue) {
-        ensureNodesIsMutable();
-        nodes_.add(builderForValue.build());
-
+        copyOnWrite();
+        instance.addNodes(builderForValue);
         return this;
       }
       /**
@@ -4092,9 +4047,8 @@ public final class Osmformat {
        */
       public Builder addNodes(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Node.Builder builderForValue) {
-        ensureNodesIsMutable();
-        nodes_.add(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.addNodes(index, builderForValue);
         return this;
       }
       /**
@@ -4102,129 +4056,97 @@ public final class Osmformat {
        */
       public Builder addAllNodes(
           java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Node> values) {
-        ensureNodesIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, nodes_);
-
+        copyOnWrite();
+        instance.addAllNodes(values);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Node nodes = 1;</code>
        */
       public Builder clearNodes() {
-        nodes_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-
+        copyOnWrite();
+        instance.clearNodes();
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Node nodes = 1;</code>
        */
       public Builder removeNodes(int index) {
-        ensureNodesIsMutable();
-        nodes_.remove(index);
-
+        copyOnWrite();
+        instance.removeNodes(index);
         return this;
       }
 
-      private org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes dense_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance();
       /**
        * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
        */
       public boolean hasDense() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
+        return instance.hasDense();
       }
       /**
        * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes getDense() {
-        return dense_;
+        return instance.getDense();
       }
       /**
        * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
        */
       public Builder setDense(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        dense_ = value;
-
-        bitField0_ |= 0x00000002;
+        copyOnWrite();
+        instance.setDense(value);
         return this;
-      }
+        }
       /**
        * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
        */
       public Builder setDense(
           org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.Builder builderForValue) {
-        dense_ = builderForValue.build();
-
-        bitField0_ |= 0x00000002;
+        copyOnWrite();
+        instance.setDense(builderForValue);
         return this;
       }
       /**
        * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
        */
       public Builder mergeDense(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes value) {
-        if (((bitField0_ & 0x00000002) == 0x00000002) &&
-            dense_ != org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance()) {
-          dense_ =
-            org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.newBuilder(dense_).mergeFrom(value).buildPartial();
-        } else {
-          dense_ = value;
-        }
-
-        bitField0_ |= 0x00000002;
+        copyOnWrite();
+        instance.mergeDense(value);
         return this;
       }
       /**
        * <code>optional .OSMPBF.DenseNodes dense = 2;</code>
        */
-      public Builder clearDense() {
-        dense_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance();
-
-        bitField0_ = (bitField0_ & ~0x00000002);
+      public Builder clearDense() {  copyOnWrite();
+        instance.clearDense();
         return this;
       }
 
-      private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Way> ways_ =
-        java.util.Collections.emptyList();
-      private void ensureWaysIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          ways_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Way>(ways_);
-          bitField0_ |= 0x00000004;
-         }
-      }
-
       /**
        * <code>repeated .OSMPBF.Way ways = 3;</code>
        */
       public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Way> getWaysList() {
-        return java.util.Collections.unmodifiableList(ways_);
+        return java.util.Collections.unmodifiableList(
+            instance.getWaysList());
       }
       /**
        * <code>repeated .OSMPBF.Way ways = 3;</code>
        */
       public int getWaysCount() {
-        return ways_.size();
-      }
-      /**
+        return instance.getWaysCount();
+      }/**
        * <code>repeated .OSMPBF.Way ways = 3;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.Way getWays(int index) {
-        return ways_.get(index);
+        return instance.getWays(index);
       }
       /**
        * <code>repeated .OSMPBF.Way ways = 3;</code>
        */
       public Builder setWays(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureWaysIsMutable();
-        ways_.set(index, value);
-
+        copyOnWrite();
+        instance.setWays(index, value);
         return this;
       }
       /**
@@ -4232,21 +4154,16 @@ public final class Osmformat {
        */
       public Builder setWays(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way.Builder builderForValue) {
-        ensureWaysIsMutable();
-        ways_.set(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.setWays(index, builderForValue);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Way ways = 3;</code>
        */
       public Builder addWays(org.openstreetmap.osmosis.osmbinary.Osmformat.Way value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureWaysIsMutable();
-        ways_.add(value);
-
+        copyOnWrite();
+        instance.addWays(value);
         return this;
       }
       /**
@@ -4254,12 +4171,8 @@ public final class Osmformat {
        */
       public Builder addWays(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureWaysIsMutable();
-        ways_.add(index, value);
-
+        copyOnWrite();
+        instance.addWays(index, value);
         return this;
       }
       /**
@@ -4267,9 +4180,8 @@ public final class Osmformat {
        */
       public Builder addWays(
           org.openstreetmap.osmosis.osmbinary.Osmformat.Way.Builder builderForValue) {
-        ensureWaysIsMutable();
-        ways_.add(builderForValue.build());
-
+        copyOnWrite();
+        instance.addWays(builderForValue);
         return this;
       }
       /**
@@ -4277,9 +4189,8 @@ public final class Osmformat {
        */
       public Builder addWays(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Way.Builder builderForValue) {
-        ensureWaysIsMutable();
-        ways_.add(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.addWays(index, builderForValue);
         return this;
       }
       /**
@@ -4287,69 +4198,52 @@ public final class Osmformat {
        */
       public Builder addAllWays(
           java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Way> values) {
-        ensureWaysIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, ways_);
-
+        copyOnWrite();
+        instance.addAllWays(values);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Way ways = 3;</code>
        */
       public Builder clearWays() {
-        ways_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-
+        copyOnWrite();
+        instance.clearWays();
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Way ways = 3;</code>
        */
       public Builder removeWays(int index) {
-        ensureWaysIsMutable();
-        ways_.remove(index);
-
+        copyOnWrite();
+        instance.removeWays(index);
         return this;
       }
 
-      private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> relations_ =
-        java.util.Collections.emptyList();
-      private void ensureRelationsIsMutable() {
-        if (!((bitField0_ & 0x00000008) == 0x00000008)) {
-          relations_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation>(relations_);
-          bitField0_ |= 0x00000008;
-         }
-      }
-
       /**
        * <code>repeated .OSMPBF.Relation relations = 4;</code>
        */
       public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> getRelationsList() {
-        return java.util.Collections.unmodifiableList(relations_);
+        return java.util.Collections.unmodifiableList(
+            instance.getRelationsList());
       }
       /**
        * <code>repeated .OSMPBF.Relation relations = 4;</code>
        */
       public int getRelationsCount() {
-        return relations_.size();
-      }
-      /**
+        return instance.getRelationsCount();
+      }/**
        * <code>repeated .OSMPBF.Relation relations = 4;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation getRelations(int index) {
-        return relations_.get(index);
+        return instance.getRelations(index);
       }
       /**
        * <code>repeated .OSMPBF.Relation relations = 4;</code>
        */
       public Builder setRelations(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureRelationsIsMutable();
-        relations_.set(index, value);
-
+        copyOnWrite();
+        instance.setRelations(index, value);
         return this;
       }
       /**
@@ -4357,21 +4251,16 @@ public final class Osmformat {
        */
       public Builder setRelations(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.Builder builderForValue) {
-        ensureRelationsIsMutable();
-        relations_.set(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.setRelations(index, builderForValue);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Relation relations = 4;</code>
        */
       public Builder addRelations(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureRelationsIsMutable();
-        relations_.add(value);
-
+        copyOnWrite();
+        instance.addRelations(value);
         return this;
       }
       /**
@@ -4379,12 +4268,8 @@ public final class Osmformat {
        */
       public Builder addRelations(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureRelationsIsMutable();
-        relations_.add(index, value);
-
+        copyOnWrite();
+        instance.addRelations(index, value);
         return this;
       }
       /**
@@ -4392,9 +4277,8 @@ public final class Osmformat {
        */
       public Builder addRelations(
           org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.Builder builderForValue) {
-        ensureRelationsIsMutable();
-        relations_.add(builderForValue.build());
-
+        copyOnWrite();
+        instance.addRelations(builderForValue);
         return this;
       }
       /**
@@ -4402,9 +4286,8 @@ public final class Osmformat {
        */
       public Builder addRelations(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.Builder builderForValue) {
-        ensureRelationsIsMutable();
-        relations_.add(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.addRelations(index, builderForValue);
         return this;
       }
       /**
@@ -4412,69 +4295,52 @@ public final class Osmformat {
        */
       public Builder addAllRelations(
           java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Relation> values) {
-        ensureRelationsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, relations_);
-
+        copyOnWrite();
+        instance.addAllRelations(values);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Relation relations = 4;</code>
        */
       public Builder clearRelations() {
-        relations_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000008);
-
+        copyOnWrite();
+        instance.clearRelations();
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Relation relations = 4;</code>
        */
       public Builder removeRelations(int index) {
-        ensureRelationsIsMutable();
-        relations_.remove(index);
-
+        copyOnWrite();
+        instance.removeRelations(index);
         return this;
       }
 
-      private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet> changesets_ =
-        java.util.Collections.emptyList();
-      private void ensureChangesetsIsMutable() {
-        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
-          changesets_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet>(changesets_);
-          bitField0_ |= 0x00000010;
-         }
-      }
-
       /**
        * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
        */
       public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet> getChangesetsList() {
-        return java.util.Collections.unmodifiableList(changesets_);
+        return java.util.Collections.unmodifiableList(
+            instance.getChangesetsList());
       }
       /**
        * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
        */
       public int getChangesetsCount() {
-        return changesets_.size();
-      }
-      /**
+        return instance.getChangesetsCount();
+      }/**
        * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet getChangesets(int index) {
-        return changesets_.get(index);
+        return instance.getChangesets(index);
       }
       /**
        * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
        */
       public Builder setChangesets(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureChangesetsIsMutable();
-        changesets_.set(index, value);
-
+        copyOnWrite();
+        instance.setChangesets(index, value);
         return this;
       }
       /**
@@ -4482,21 +4348,16 @@ public final class Osmformat {
        */
       public Builder setChangesets(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.Builder builderForValue) {
-        ensureChangesetsIsMutable();
-        changesets_.set(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.setChangesets(index, builderForValue);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
        */
       public Builder addChangesets(org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureChangesetsIsMutable();
-        changesets_.add(value);
-
+        copyOnWrite();
+        instance.addChangesets(value);
         return this;
       }
       /**
@@ -4504,12 +4365,8 @@ public final class Osmformat {
        */
       public Builder addChangesets(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureChangesetsIsMutable();
-        changesets_.add(index, value);
-
+        copyOnWrite();
+        instance.addChangesets(index, value);
         return this;
       }
       /**
@@ -4517,9 +4374,8 @@ public final class Osmformat {
        */
       public Builder addChangesets(
           org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.Builder builderForValue) {
-        ensureChangesetsIsMutable();
-        changesets_.add(builderForValue.build());
-
+        copyOnWrite();
+        instance.addChangesets(builderForValue);
         return this;
       }
       /**
@@ -4527,9 +4383,8 @@ public final class Osmformat {
        */
       public Builder addChangesets(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.Builder builderForValue) {
-        ensureChangesetsIsMutable();
-        changesets_.add(index, builderForValue.build());
-
+        copyOnWrite();
+        instance.addChangesets(index, builderForValue);
         return this;
       }
       /**
@@ -4537,40 +4392,215 @@ public final class Osmformat {
        */
       public Builder addAllChangesets(
           java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet> values) {
-        ensureChangesetsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, changesets_);
-
+        copyOnWrite();
+        instance.addAllChangesets(values);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
        */
       public Builder clearChangesets() {
-        changesets_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-
+        copyOnWrite();
+        instance.clearChangesets();
         return this;
       }
       /**
        * <code>repeated .OSMPBF.ChangeSet changesets = 5;</code>
        */
       public Builder removeChangesets(int index) {
-        ensureChangesetsIsMutable();
-        changesets_.remove(index);
-
+        copyOnWrite();
+        instance.removeChangesets(index);
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.PrimitiveGroup)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          for (int i = 0; i < getNodesCount(); i++) {
+            if (!getNodes(i).isInitialized()) {
+              if (shouldMemoize) {
+                memoizedIsInitialized = 0;
+              }
+              return null;
+            }
+          }
+          for (int i = 0; i < getWaysCount(); i++) {
+            if (!getWays(i).isInitialized()) {
+              if (shouldMemoize) {
+                memoizedIsInitialized = 0;
+              }
+              return null;
+            }
+          }
+          for (int i = 0; i < getRelationsCount(); i++) {
+            if (!getRelations(i).isInitialized()) {
+              if (shouldMemoize) {
+                memoizedIsInitialized = 0;
+              }
+              return null;
+            }
+          }
+          for (int i = 0; i < getChangesetsCount(); i++) {
+            if (!getChangesets(i).isInitialized()) {
+              if (shouldMemoize) {
+                memoizedIsInitialized = 0;
+              }
+              return null;
+            }
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
+
+        }
+        case MAKE_IMMUTABLE: {
+          nodes_.makeImmutable();
+          ways_.makeImmutable();
+          relations_.makeImmutable();
+          changesets_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup other = (org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup) arg1;
+          nodes_= visitor.visitList(nodes_, other.nodes_);
+          dense_ = visitor.visitMessage(dense_, other.dense_);
+          ways_= visitor.visitList(ways_, other.ways_);
+          relations_= visitor.visitList(relations_, other.relations_);
+          changesets_= visitor.visitList(changesets_, other.changesets_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 10: {
+                  if (!nodes_.isModifiable()) {
+                    nodes_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(nodes_);
+                  }
+                  nodes_.add(
+                      input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Node.parser(), extensionRegistry));
+                  break;
+                }
+                case 18: {
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.Builder subBuilder = null;
+                  if (((bitField0_ & 0x00000001) == 0x00000001)) {
+                    subBuilder = dense_.toBuilder();
+                  }
+                  dense_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.parser(), extensionRegistry);
+                  if (subBuilder != null) {
+                    subBuilder.mergeFrom(dense_);
+                    dense_ = subBuilder.buildPartial();
+                  }
+                  bitField0_ |= 0x00000001;
+                  break;
+                }
+                case 26: {
+                  if (!ways_.isModifiable()) {
+                    ways_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(ways_);
+                  }
+                  ways_.add(
+                      input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Way.parser(), extensionRegistry));
+                  break;
+                }
+                case 34: {
+                  if (!relations_.isModifiable()) {
+                    relations_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(relations_);
+                  }
+                  relations_.add(
+                      input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.parser(), extensionRegistry));
+                  break;
+                }
+                case 42: {
+                  if (!changesets_.isModifiable()) {
+                    changesets_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(changesets_);
+                  }
+                  changesets_.add(
+                      input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.parser(), extensionRegistry));
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
+
 
+    // @@protoc_insertion_point(class_scope:OSMPBF.PrimitiveGroup)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup DEFAULT_INSTANCE;
     static {
-      defaultInstance = new PrimitiveGroup(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new PrimitiveGroup();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.PrimitiveGroup)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<PrimitiveGroup> PARSER;
+
+    public static com.google.protobuf.Parser<PrimitiveGroup> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface StringTableOrBuilder extends
@@ -4591,107 +4621,24 @@ public final class Osmformat {
     com.google.protobuf.ByteString getS(int index);
   }
   /**
-   * Protobuf type {@code OSMPBF.StringTable}
-   *
    * <pre>
    ** String table, contains the common strings in each block.
    *Note that we reserve index '0' as a delimiter, so the entry at that
    *index in the table is ALWAYS blank and unused.
    * </pre>
+   *
+   * Protobuf type {@code OSMPBF.StringTable}
    */
-  public static final class StringTable extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class StringTable extends
+      com.google.protobuf.GeneratedMessageLite<
+          StringTable, StringTable.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.StringTable)
       StringTableOrBuilder {
-    // Use StringTable.newBuilder() to construct.
-    private StringTable(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private StringTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final StringTable defaultInstance;
-    public static StringTable getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public StringTable getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private StringTable(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 10: {
-              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-                s_ = new java.util.ArrayList<com.google.protobuf.ByteString>();
-                mutable_bitField0_ |= 0x00000001;
-              }
-              s_.add(input.readBytes());
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-          s_ = java.util.Collections.unmodifiableList(s_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<StringTable> PARSER =
-        new com.google.protobuf.AbstractParser<StringTable>() {
-      public StringTable parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new StringTable(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<StringTable> getParserForType() {
-      return PARSER;
+    private StringTable() {
+      s_ = emptyProtobufList();
     }
-
     public static final int S_FIELD_NUMBER = 1;
-    private java.util.List<com.google.protobuf.ByteString> s_;
+    private com.google.protobuf.Internal.ProtobufList<com.google.protobuf.ByteString> s_;
     /**
      * <code>repeated bytes s = 1;</code>
      */
@@ -4711,30 +4658,57 @@ public final class Osmformat {
     public com.google.protobuf.ByteString getS(int index) {
       return s_.get(index);
     }
-
-    private void initFields() {
-      s_ = java.util.Collections.emptyList();
+    private void ensureSIsMutable() {
+      if (!s_.isModifiable()) {
+        s_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(s_);
+       }
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <code>repeated bytes s = 1;</code>
+     */
+    private void setS(
+        int index, com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureSIsMutable();
+      s_.set(index, value);
+    }
+    /**
+     * <code>repeated bytes s = 1;</code>
+     */
+    private void addS(com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureSIsMutable();
+      s_.add(value);
+    }
+    /**
+     * <code>repeated bytes s = 1;</code>
+     */
+    private void addAllS(
+        java.lang.Iterable<? extends com.google.protobuf.ByteString> values) {
+      ensureSIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, s_);
+    }
+    /**
+     * <code>repeated bytes s = 1;</code>
+     */
+    private void clearS() {
+      s_ = emptyProtobufList();
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       for (int i = 0; i < s_.size(); i++) {
         output.writeBytes(1, s_.get(i));
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -4749,227 +4723,134 @@ public final class Osmformat {
         size += dataSize;
         size += 1 * getSList().size();
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
-     * Protobuf type {@code OSMPBF.StringTable}
-     *
      * <pre>
      ** String table, contains the common strings in each block.
      *Note that we reserve index '0' as a delimiter, so the entry at that
      *index in the table is ALWAYS blank and unused.
      * </pre>
+     *
+     * Protobuf type {@code OSMPBF.StringTable}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.StringTable)
         org.openstreetmap.osmosis.osmbinary.Osmformat.StringTableOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        s_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        return this;
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable result = new org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable(this);
-        int from_bitField0_ = bitField0_;
-        if (((bitField0_ & 0x00000001) == 0x00000001)) {
-          s_ = java.util.Collections.unmodifiableList(s_);
-          bitField0_ = (bitField0_ & ~0x00000001);
-        }
-        result.s_ = s_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.getDefaultInstance()) return this;
-        if (!other.s_.isEmpty()) {
-          if (s_.isEmpty()) {
-            s_ = other.s_;
-            bitField0_ = (bitField0_ & ~0x00000001);
-          } else {
-            ensureSIsMutable();
-            s_.addAll(other.s_);
-          }
-          
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        return true;
-      }
 
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
-
-      private java.util.List<com.google.protobuf.ByteString> s_ = java.util.Collections.emptyList();
-      private void ensureSIsMutable() {
-        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
-          s_ = new java.util.ArrayList<com.google.protobuf.ByteString>(s_);
-          bitField0_ |= 0x00000001;
-         }
-      }
       /**
        * <code>repeated bytes s = 1;</code>
        */
       public java.util.List<com.google.protobuf.ByteString>
           getSList() {
-        return java.util.Collections.unmodifiableList(s_);
+        return java.util.Collections.unmodifiableList(
+            instance.getSList());
       }
       /**
        * <code>repeated bytes s = 1;</code>
        */
       public int getSCount() {
-        return s_.size();
+        return instance.getSCount();
       }
       /**
        * <code>repeated bytes s = 1;</code>
        */
       public com.google.protobuf.ByteString getS(int index) {
-        return s_.get(index);
+        return instance.getS(index);
       }
       /**
        * <code>repeated bytes s = 1;</code>
        */
       public Builder setS(
           int index, com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureSIsMutable();
-        s_.set(index, value);
-        
+        copyOnWrite();
+        instance.setS(index, value);
         return this;
       }
       /**
        * <code>repeated bytes s = 1;</code>
        */
       public Builder addS(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  ensureSIsMutable();
-        s_.add(value);
-        
+        copyOnWrite();
+        instance.addS(value);
         return this;
       }
       /**
@@ -4977,31 +4858,118 @@ public final class Osmformat {
        */
       public Builder addAllS(
           java.lang.Iterable<? extends com.google.protobuf.ByteString> values) {
-        ensureSIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, s_);
-        
+        copyOnWrite();
+        instance.addAllS(values);
         return this;
       }
       /**
        * <code>repeated bytes s = 1;</code>
        */
       public Builder clearS() {
-        s_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        
+        copyOnWrite();
+        instance.clearS();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.StringTable)
     }
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable();
+        }
+        case IS_INITIALIZED: {
+          return DEFAULT_INSTANCE;
+        }
+        case MAKE_IMMUTABLE: {
+          s_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable other = (org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable) arg1;
+          s_= visitor.visitList(s_, other.s_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 10: {
+                  if (!s_.isModifiable()) {
+                    s_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(s_);
+                  }
+                  s_.add(input.readBytes());
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
 
+
+    // @@protoc_insertion_point(class_scope:OSMPBF.StringTable)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable DEFAULT_INSTANCE;
     static {
-      defaultInstance = new StringTable(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new StringTable();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.StringTable)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.StringTable getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<StringTable> PARSER;
+
+    public static com.google.protobuf.Parser<StringTable> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface InfoOrBuilder extends
@@ -5045,25 +5013,23 @@ public final class Osmformat {
     int getUid();
 
     /**
-     * <code>optional uint32 user_sid = 5;</code>
-     *
      * <pre>
      * String IDs
      * </pre>
+     *
+     * <code>optional uint32 user_sid = 5;</code>
      */
     boolean hasUserSid();
     /**
-     * <code>optional uint32 user_sid = 5;</code>
-     *
      * <pre>
      * String IDs
      * </pre>
+     *
+     * <code>optional uint32 user_sid = 5;</code>
      */
     int getUserSid();
 
     /**
-     * <code>optional bool visible = 6;</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -5074,11 +5040,11 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>optional bool visible = 6;</code>
      */
     boolean hasVisible();
     /**
-     * <code>optional bool visible = 6;</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -5089,126 +5055,26 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>optional bool visible = 6;</code>
      */
     boolean getVisible();
   }
   /**
-   * Protobuf type {@code OSMPBF.Info}
-   *
    * <pre>
    * Optional metadata that may be included into each primitive. 
    * </pre>
+   *
+   * Protobuf type {@code OSMPBF.Info}
    */
-  public static final class Info extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class Info extends
+      com.google.protobuf.GeneratedMessageLite<
+          Info, Info.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.Info)
       InfoOrBuilder {
-    // Use Info.newBuilder() to construct.
-    private Info(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private Info(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final Info defaultInstance;
-    public static Info getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public Info getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private Info(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              bitField0_ |= 0x00000001;
-              version_ = input.readInt32();
-              break;
-            }
-            case 16: {
-              bitField0_ |= 0x00000002;
-              timestamp_ = input.readInt64();
-              break;
-            }
-            case 24: {
-              bitField0_ |= 0x00000004;
-              changeset_ = input.readInt64();
-              break;
-            }
-            case 32: {
-              bitField0_ |= 0x00000008;
-              uid_ = input.readInt32();
-              break;
-            }
-            case 40: {
-              bitField0_ |= 0x00000010;
-              userSid_ = input.readUInt32();
-              break;
-            }
-            case 48: {
-              bitField0_ |= 0x00000020;
-              visible_ = input.readBool();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<Info> PARSER =
-        new com.google.protobuf.AbstractParser<Info>() {
-      public Info parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new Info(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<Info> getParserForType() {
-      return PARSER;
+    private Info() {
+      version_ = -1;
     }
-
     private int bitField0_;
     public static final int VERSION_FIELD_NUMBER = 1;
     private int version_;
@@ -5224,6 +5090,20 @@ public final class Osmformat {
     public int getVersion() {
       return version_;
     }
+    /**
+     * <code>optional int32 version = 1 [default = -1];</code>
+     */
+    private void setVersion(int value) {
+      bitField0_ |= 0x00000001;
+      version_ = value;
+    }
+    /**
+     * <code>optional int32 version = 1 [default = -1];</code>
+     */
+    private void clearVersion() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      version_ = -1;
+    }
 
     public static final int TIMESTAMP_FIELD_NUMBER = 2;
     private long timestamp_;
@@ -5239,6 +5119,20 @@ public final class Osmformat {
     public long getTimestamp() {
       return timestamp_;
     }
+    /**
+     * <code>optional int64 timestamp = 2;</code>
+     */
+    private void setTimestamp(long value) {
+      bitField0_ |= 0x00000002;
+      timestamp_ = value;
+    }
+    /**
+     * <code>optional int64 timestamp = 2;</code>
+     */
+    private void clearTimestamp() {
+      bitField0_ = (bitField0_ & ~0x00000002);
+      timestamp_ = 0L;
+    }
 
     public static final int CHANGESET_FIELD_NUMBER = 3;
     private long changeset_;
@@ -5254,6 +5148,20 @@ public final class Osmformat {
     public long getChangeset() {
       return changeset_;
     }
+    /**
+     * <code>optional int64 changeset = 3;</code>
+     */
+    private void setChangeset(long value) {
+      bitField0_ |= 0x00000004;
+      changeset_ = value;
+    }
+    /**
+     * <code>optional int64 changeset = 3;</code>
+     */
+    private void clearChangeset() {
+      bitField0_ = (bitField0_ & ~0x00000004);
+      changeset_ = 0L;
+    }
 
     public static final int UID_FIELD_NUMBER = 4;
     private int uid_;
@@ -5269,35 +5177,69 @@ public final class Osmformat {
     public int getUid() {
       return uid_;
     }
+    /**
+     * <code>optional int32 uid = 4;</code>
+     */
+    private void setUid(int value) {
+      bitField0_ |= 0x00000008;
+      uid_ = value;
+    }
+    /**
+     * <code>optional int32 uid = 4;</code>
+     */
+    private void clearUid() {
+      bitField0_ = (bitField0_ & ~0x00000008);
+      uid_ = 0;
+    }
 
     public static final int USER_SID_FIELD_NUMBER = 5;
     private int userSid_;
     /**
-     * <code>optional uint32 user_sid = 5;</code>
-     *
      * <pre>
      * String IDs
      * </pre>
+     *
+     * <code>optional uint32 user_sid = 5;</code>
      */
     public boolean hasUserSid() {
       return ((bitField0_ & 0x00000010) == 0x00000010);
     }
     /**
-     * <code>optional uint32 user_sid = 5;</code>
-     *
      * <pre>
      * String IDs
      * </pre>
+     *
+     * <code>optional uint32 user_sid = 5;</code>
      */
     public int getUserSid() {
       return userSid_;
     }
+    /**
+     * <pre>
+     * String IDs
+     * </pre>
+     *
+     * <code>optional uint32 user_sid = 5;</code>
+     */
+    private void setUserSid(int value) {
+      bitField0_ |= 0x00000010;
+      userSid_ = value;
+    }
+    /**
+     * <pre>
+     * String IDs
+     * </pre>
+     *
+     * <code>optional uint32 user_sid = 5;</code>
+     */
+    private void clearUserSid() {
+      bitField0_ = (bitField0_ & ~0x00000010);
+      userSid_ = 0;
+    }
 
     public static final int VISIBLE_FIELD_NUMBER = 6;
     private boolean visible_;
     /**
-     * <code>optional bool visible = 6;</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -5308,13 +5250,48 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>optional bool visible = 6;</code>
      */
     public boolean hasVisible() {
       return ((bitField0_ & 0x00000020) == 0x00000020);
     }
     /**
+     * <pre>
+     * The visible flag is used to store history information. It indicates that
+     * the current object version has been created by a delete operation on the
+     * OSM API.
+     * When a writer sets this flag, it MUST add a required_features tag with
+     * value "HistoricalInformation" to the HeaderBlock.
+     * If this flag is not available for some object it MUST be assumed to be
+     * true if the file has the required_features tag "HistoricalInformation"
+     * set.
+     * </pre>
+     *
      * <code>optional bool visible = 6;</code>
+     */
+    public boolean getVisible() {
+      return visible_;
+    }
+    /**
+     * <pre>
+     * The visible flag is used to store history information. It indicates that
+     * the current object version has been created by a delete operation on the
+     * OSM API.
+     * When a writer sets this flag, it MUST add a required_features tag with
+     * value "HistoricalInformation" to the HeaderBlock.
+     * If this flag is not available for some object it MUST be assumed to be
+     * true if the file has the required_features tag "HistoricalInformation"
+     * set.
+     * </pre>
      *
+     * <code>optional bool visible = 6;</code>
+     */
+    private void setVisible(boolean value) {
+      bitField0_ |= 0x00000020;
+      visible_ = value;
+    }
+    /**
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -5325,32 +5302,16 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>optional bool visible = 6;</code>
      */
-    public boolean getVisible() {
-      return visible_;
-    }
-
-    private void initFields() {
-      version_ = -1;
-      timestamp_ = 0L;
-      changeset_ = 0L;
-      uid_ = 0;
-      userSid_ = 0;
+    private void clearVisible() {
+      bitField0_ = (bitField0_ & ~0x00000020);
       visible_ = false;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      memoizedIsInitialized = 1;
-      return true;
-    }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         output.writeInt32(1, version_);
       }
@@ -5369,10 +5330,9 @@ public final class Osmformat {
       if (((bitField0_ & 0x00000020) == 0x00000020)) {
         output.writeBool(6, visible_);
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -5402,395 +5362,259 @@ public final class Osmformat {
         size += com.google.protobuf.CodedOutputStream
           .computeBoolSize(6, visible_);
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.Info prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
-     * Protobuf type {@code OSMPBF.Info}
-     *
      * <pre>
      * Optional metadata that may be included into each primitive. 
      * </pre>
+     *
+     * Protobuf type {@code OSMPBF.Info}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.Info, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Info, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.Info)
         org.openstreetmap.osmosis.osmbinary.Osmformat.InfoOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.Info.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        version_ = -1;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        timestamp_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        changeset_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000004);
-        uid_ = 0;
-        bitField0_ = (bitField0_ & ~0x00000008);
-        userSid_ = 0;
-        bitField0_ = (bitField0_ & ~0x00000010);
-        visible_ = false;
-        bitField0_ = (bitField0_ & ~0x00000020);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
+        super(DEFAULT_INSTANCE);
       }
 
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Info build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Info result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Info buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Info result = new org.openstreetmap.osmosis.osmbinary.Osmformat.Info(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.version_ = version_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.timestamp_ = timestamp_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
-          to_bitField0_ |= 0x00000004;
-        }
-        result.changeset_ = changeset_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000008;
-        }
-        result.uid_ = uid_;
-        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
-          to_bitField0_ |= 0x00000010;
-        }
-        result.userSid_ = userSid_;
-        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
-          to_bitField0_ |= 0x00000020;
-        }
-        result.visible_ = visible_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.Info other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance()) return this;
-        if (other.hasVersion()) {
-          setVersion(other.getVersion());
-        }
-        if (other.hasTimestamp()) {
-          setTimestamp(other.getTimestamp());
-        }
-        if (other.hasChangeset()) {
-          setChangeset(other.getChangeset());
-        }
-        if (other.hasUid()) {
-          setUid(other.getUid());
-        }
-        if (other.hasUserSid()) {
-          setUserSid(other.getUserSid());
-        }
-        if (other.hasVisible()) {
-          setVisible(other.getVisible());
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Info parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.Info) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private int version_ = -1;
       /**
        * <code>optional int32 version = 1 [default = -1];</code>
        */
       public boolean hasVersion() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasVersion();
       }
       /**
        * <code>optional int32 version = 1 [default = -1];</code>
        */
       public int getVersion() {
-        return version_;
+        return instance.getVersion();
       }
       /**
        * <code>optional int32 version = 1 [default = -1];</code>
        */
       public Builder setVersion(int value) {
-        bitField0_ |= 0x00000001;
-        version_ = value;
-        
+        copyOnWrite();
+        instance.setVersion(value);
         return this;
       }
       /**
        * <code>optional int32 version = 1 [default = -1];</code>
        */
       public Builder clearVersion() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        version_ = -1;
-        
+        copyOnWrite();
+        instance.clearVersion();
         return this;
       }
 
-      private long timestamp_ ;
       /**
        * <code>optional int64 timestamp = 2;</code>
        */
       public boolean hasTimestamp() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
+        return instance.hasTimestamp();
       }
       /**
        * <code>optional int64 timestamp = 2;</code>
        */
       public long getTimestamp() {
-        return timestamp_;
+        return instance.getTimestamp();
       }
       /**
        * <code>optional int64 timestamp = 2;</code>
        */
       public Builder setTimestamp(long value) {
-        bitField0_ |= 0x00000002;
-        timestamp_ = value;
-        
+        copyOnWrite();
+        instance.setTimestamp(value);
         return this;
       }
       /**
        * <code>optional int64 timestamp = 2;</code>
        */
       public Builder clearTimestamp() {
-        bitField0_ = (bitField0_ & ~0x00000002);
-        timestamp_ = 0L;
-        
+        copyOnWrite();
+        instance.clearTimestamp();
         return this;
       }
 
-      private long changeset_ ;
       /**
        * <code>optional int64 changeset = 3;</code>
        */
       public boolean hasChangeset() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
+        return instance.hasChangeset();
       }
       /**
        * <code>optional int64 changeset = 3;</code>
        */
       public long getChangeset() {
-        return changeset_;
+        return instance.getChangeset();
       }
       /**
        * <code>optional int64 changeset = 3;</code>
        */
       public Builder setChangeset(long value) {
-        bitField0_ |= 0x00000004;
-        changeset_ = value;
-        
+        copyOnWrite();
+        instance.setChangeset(value);
         return this;
       }
       /**
        * <code>optional int64 changeset = 3;</code>
        */
       public Builder clearChangeset() {
-        bitField0_ = (bitField0_ & ~0x00000004);
-        changeset_ = 0L;
-        
+        copyOnWrite();
+        instance.clearChangeset();
         return this;
       }
 
-      private int uid_ ;
       /**
        * <code>optional int32 uid = 4;</code>
        */
       public boolean hasUid() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasUid();
       }
       /**
        * <code>optional int32 uid = 4;</code>
        */
       public int getUid() {
-        return uid_;
+        return instance.getUid();
       }
       /**
        * <code>optional int32 uid = 4;</code>
        */
       public Builder setUid(int value) {
-        bitField0_ |= 0x00000008;
-        uid_ = value;
-        
+        copyOnWrite();
+        instance.setUid(value);
         return this;
       }
       /**
        * <code>optional int32 uid = 4;</code>
        */
       public Builder clearUid() {
-        bitField0_ = (bitField0_ & ~0x00000008);
-        uid_ = 0;
-        
+        copyOnWrite();
+        instance.clearUid();
         return this;
       }
 
-      private int userSid_ ;
       /**
-       * <code>optional uint32 user_sid = 5;</code>
-       *
        * <pre>
        * String IDs
        * </pre>
+       *
+       * <code>optional uint32 user_sid = 5;</code>
        */
       public boolean hasUserSid() {
-        return ((bitField0_ & 0x00000010) == 0x00000010);
+        return instance.hasUserSid();
       }
       /**
-       * <code>optional uint32 user_sid = 5;</code>
-       *
        * <pre>
        * String IDs
        * </pre>
+       *
+       * <code>optional uint32 user_sid = 5;</code>
        */
       public int getUserSid() {
-        return userSid_;
+        return instance.getUserSid();
       }
       /**
-       * <code>optional uint32 user_sid = 5;</code>
-       *
        * <pre>
        * String IDs
        * </pre>
+       *
+       * <code>optional uint32 user_sid = 5;</code>
        */
       public Builder setUserSid(int value) {
-        bitField0_ |= 0x00000010;
-        userSid_ = value;
-        
+        copyOnWrite();
+        instance.setUserSid(value);
         return this;
       }
       /**
-       * <code>optional uint32 user_sid = 5;</code>
-       *
        * <pre>
        * String IDs
        * </pre>
+       *
+       * <code>optional uint32 user_sid = 5;</code>
        */
       public Builder clearUserSid() {
-        bitField0_ = (bitField0_ & ~0x00000010);
-        userSid_ = 0;
-        
+        copyOnWrite();
+        instance.clearUserSid();
         return this;
       }
 
-      private boolean visible_ ;
       /**
-       * <code>optional bool visible = 6;</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -5801,13 +5625,13 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>optional bool visible = 6;</code>
        */
       public boolean hasVisible() {
-        return ((bitField0_ & 0x00000020) == 0x00000020);
+        return instance.hasVisible();
       }
       /**
-       * <code>optional bool visible = 6;</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -5818,13 +5642,13 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>optional bool visible = 6;</code>
        */
       public boolean getVisible() {
-        return visible_;
+        return instance.getVisible();
       }
       /**
-       * <code>optional bool visible = 6;</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -5835,16 +5659,15 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>optional bool visible = 6;</code>
        */
       public Builder setVisible(boolean value) {
-        bitField0_ |= 0x00000020;
-        visible_ = value;
-        
+        copyOnWrite();
+        instance.setVisible(value);
         return this;
       }
       /**
-       * <code>optional bool visible = 6;</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -5855,23 +5678,153 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>optional bool visible = 6;</code>
        */
       public Builder clearVisible() {
-        bitField0_ = (bitField0_ & ~0x00000020);
-        visible_ = false;
-        
+        copyOnWrite();
+        instance.clearVisible();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.Info)
     }
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.Info();
+        }
+        case IS_INITIALIZED: {
+          return DEFAULT_INSTANCE;
+        }
+        case MAKE_IMMUTABLE: {
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Info other = (org.openstreetmap.osmosis.osmbinary.Osmformat.Info) arg1;
+          version_ = visitor.visitInt(
+              hasVersion(), version_,
+              other.hasVersion(), other.version_);
+          timestamp_ = visitor.visitLong(
+              hasTimestamp(), timestamp_,
+              other.hasTimestamp(), other.timestamp_);
+          changeset_ = visitor.visitLong(
+              hasChangeset(), changeset_,
+              other.hasChangeset(), other.changeset_);
+          uid_ = visitor.visitInt(
+              hasUid(), uid_,
+              other.hasUid(), other.uid_);
+          userSid_ = visitor.visitInt(
+              hasUserSid(), userSid_,
+              other.hasUserSid(), other.userSid_);
+          visible_ = visitor.visitBoolean(
+              hasVisible(), visible_,
+              other.hasVisible(), other.visible_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  bitField0_ |= 0x00000001;
+                  version_ = input.readInt32();
+                  break;
+                }
+                case 16: {
+                  bitField0_ |= 0x00000002;
+                  timestamp_ = input.readInt64();
+                  break;
+                }
+                case 24: {
+                  bitField0_ |= 0x00000004;
+                  changeset_ = input.readInt64();
+                  break;
+                }
+                case 32: {
+                  bitField0_ |= 0x00000008;
+                  uid_ = input.readInt32();
+                  break;
+                }
+                case 40: {
+                  bitField0_ |= 0x00000010;
+                  userSid_ = input.readUInt32();
+                  break;
+                }
+                case 48: {
+                  bitField0_ |= 0x00000020;
+                  visible_ = input.readBool();
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.Info.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
 
+
+    // @@protoc_insertion_point(class_scope:OSMPBF.Info)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.Info DEFAULT_INSTANCE;
     static {
-      defaultInstance = new Info(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new Info();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.Info)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.Info getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<Info> PARSER;
+
+    public static com.google.protobuf.Parser<Info> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface DenseInfoOrBuilder extends
@@ -5892,108 +5845,106 @@ public final class Osmformat {
     int getVersion(int index);
 
     /**
-     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
      */
     java.util.List<java.lang.Long> getTimestampList();
     /**
-     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
      */
     int getTimestampCount();
     /**
-     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
      */
     long getTimestamp(int index);
 
     /**
-     * <code>repeated sint64 changeset = 3 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
      */
     java.util.List<java.lang.Long> getChangesetList();
     /**
-     * <code>repeated sint64 changeset = 3 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
      */
     int getChangesetCount();
     /**
-     * <code>repeated sint64 changeset = 3 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
      */
     long getChangeset(int index);
 
     /**
-     * <code>repeated sint32 uid = 4 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getUidList();
     /**
-     * <code>repeated sint32 uid = 4 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
      */
     int getUidCount();
     /**
-     * <code>repeated sint32 uid = 4 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
      */
     int getUid(int index);
 
     /**
-     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-     *
      * <pre>
      * String IDs for usernames. DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getUserSidList();
     /**
-     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-     *
      * <pre>
      * String IDs for usernames. DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
      */
     int getUserSidCount();
     /**
-     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-     *
      * <pre>
      * String IDs for usernames. DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
      */
     int getUserSid(int index);
 
     /**
-     * <code>repeated bool visible = 6 [packed = true];</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -6004,11 +5955,11 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
      */
     java.util.List<java.lang.Boolean> getVisibleList();
     /**
-     * <code>repeated bool visible = 6 [packed = true];</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -6019,11 +5970,11 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
      */
     int getVisibleCount();
     /**
-     * <code>repeated bool visible = 6 [packed = true];</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -6034,242 +5985,33 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
      */
     boolean getVisible(int index);
   }
   /**
-   * Protobuf type {@code OSMPBF.DenseInfo}
-   *
    * <pre>
    ** Optional metadata that may be included into each primitive. Special dense format used in DenseNodes. 
    * </pre>
+   *
+   * Protobuf type {@code OSMPBF.DenseInfo}
    */
-  public static final class DenseInfo extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class DenseInfo extends
+      com.google.protobuf.GeneratedMessageLite<
+          DenseInfo, DenseInfo.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.DenseInfo)
       DenseInfoOrBuilder {
-    // Use DenseInfo.newBuilder() to construct.
-    private DenseInfo(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private DenseInfo(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final DenseInfo defaultInstance;
-    public static DenseInfo getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public DenseInfo getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private DenseInfo(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-                version_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000001;
-              }
-              version_.add(input.readInt32());
-              break;
-            }
-            case 10: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) {
-                version_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000001;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                version_.add(input.readInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 16: {
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                timestamp_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              timestamp_.add(input.readSInt64());
-              break;
-            }
-            case 18: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
-                timestamp_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                timestamp_.add(input.readSInt64());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 24: {
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                changeset_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              changeset_.add(input.readSInt64());
-              break;
-            }
-            case 26: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
-                changeset_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                changeset_.add(input.readSInt64());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 32: {
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-                uid_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              uid_.add(input.readSInt32());
-              break;
-            }
-            case 34: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) {
-                uid_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                uid_.add(input.readSInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 40: {
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-                userSid_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              userSid_.add(input.readSInt32());
-              break;
-            }
-            case 42: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) {
-                userSid_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                userSid_.add(input.readSInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 48: {
-              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
-                visible_ = new java.util.ArrayList<java.lang.Boolean>();
-                mutable_bitField0_ |= 0x00000020;
-              }
-              visible_.add(input.readBool());
-              break;
-            }
-            case 50: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
-                visible_ = new java.util.ArrayList<java.lang.Boolean>();
-                mutable_bitField0_ |= 0x00000020;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                visible_.add(input.readBool());
-              }
-              input.popLimit(limit);
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-          version_ = java.util.Collections.unmodifiableList(version_);
-        }
-        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-          timestamp_ = java.util.Collections.unmodifiableList(timestamp_);
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          changeset_ = java.util.Collections.unmodifiableList(changeset_);
-        }
-        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-          uid_ = java.util.Collections.unmodifiableList(uid_);
-        }
-        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-          userSid_ = java.util.Collections.unmodifiableList(userSid_);
-        }
-        if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
-          visible_ = java.util.Collections.unmodifiableList(visible_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
+    private DenseInfo() {
+      version_ = emptyIntList();
+      timestamp_ = emptyLongList();
+      changeset_ = emptyLongList();
+      uid_ = emptyIntList();
+      userSid_ = emptyIntList();
+      visible_ = emptyBooleanList();
     }
-    public static com.google.protobuf.Parser<DenseInfo> PARSER =
-        new com.google.protobuf.AbstractParser<DenseInfo>() {
-      public DenseInfo parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new DenseInfo(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<DenseInfo> getParserForType() {
-      return PARSER;
-    }
-
     public static final int VERSION_FIELD_NUMBER = 1;
-    private java.util.List<java.lang.Integer> version_;
+    private com.google.protobuf.Internal.IntList version_;
     /**
      * <code>repeated int32 version = 1 [packed = true];</code>
      */
@@ -6280,162 +6022,404 @@ public final class Osmformat {
     /**
      * <code>repeated int32 version = 1 [packed = true];</code>
      */
-    public int getVersionCount() {
-      return version_.size();
+    public int getVersionCount() {
+      return version_.size();
+    }
+    /**
+     * <code>repeated int32 version = 1 [packed = true];</code>
+     */
+    public int getVersion(int index) {
+      return version_.getInt(index);
+    }
+    private int versionMemoizedSerializedSize = -1;
+    private void ensureVersionIsMutable() {
+      if (!version_.isModifiable()) {
+        version_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(version_);
+       }
+    }
+    /**
+     * <code>repeated int32 version = 1 [packed = true];</code>
+     */
+    private void setVersion(
+        int index, int value) {
+      ensureVersionIsMutable();
+      version_.setInt(index, value);
+    }
+    /**
+     * <code>repeated int32 version = 1 [packed = true];</code>
+     */
+    private void addVersion(int value) {
+      ensureVersionIsMutable();
+      version_.addInt(value);
+    }
+    /**
+     * <code>repeated int32 version = 1 [packed = true];</code>
+     */
+    private void addAllVersion(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureVersionIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, version_);
     }
     /**
      * <code>repeated int32 version = 1 [packed = true];</code>
      */
-    public int getVersion(int index) {
-      return version_.get(index);
+    private void clearVersion() {
+      version_ = emptyIntList();
     }
-    private int versionMemoizedSerializedSize = -1;
 
     public static final int TIMESTAMP_FIELD_NUMBER = 2;
-    private java.util.List<java.lang.Long> timestamp_;
+    private com.google.protobuf.Internal.LongList timestamp_;
     /**
-     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
      */
     public java.util.List<java.lang.Long>
         getTimestampList() {
       return timestamp_;
     }
     /**
-     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
      */
     public int getTimestampCount() {
       return timestamp_.size();
     }
     /**
-     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
      */
     public long getTimestamp(int index) {
-      return timestamp_.get(index);
+      return timestamp_.getLong(index);
     }
     private int timestampMemoizedSerializedSize = -1;
+    private void ensureTimestampIsMutable() {
+      if (!timestamp_.isModifiable()) {
+        timestamp_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(timestamp_);
+       }
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
+     */
+    private void setTimestamp(
+        int index, long value) {
+      ensureTimestampIsMutable();
+      timestamp_.setLong(index, value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
+     */
+    private void addTimestamp(long value) {
+      ensureTimestampIsMutable();
+      timestamp_.addLong(value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
+     */
+    private void addAllTimestamp(
+        java.lang.Iterable<? extends java.lang.Long> values) {
+      ensureTimestampIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, timestamp_);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 timestamp = 2 [packed = true];</code>
+     */
+    private void clearTimestamp() {
+      timestamp_ = emptyLongList();
+    }
 
     public static final int CHANGESET_FIELD_NUMBER = 3;
-    private java.util.List<java.lang.Long> changeset_;
+    private com.google.protobuf.Internal.LongList changeset_;
     /**
-     * <code>repeated sint64 changeset = 3 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
      */
     public java.util.List<java.lang.Long>
         getChangesetList() {
       return changeset_;
     }
     /**
-     * <code>repeated sint64 changeset = 3 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
      */
     public int getChangesetCount() {
       return changeset_.size();
     }
     /**
-     * <code>repeated sint64 changeset = 3 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
      */
     public long getChangeset(int index) {
-      return changeset_.get(index);
+      return changeset_.getLong(index);
     }
     private int changesetMemoizedSerializedSize = -1;
+    private void ensureChangesetIsMutable() {
+      if (!changeset_.isModifiable()) {
+        changeset_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(changeset_);
+       }
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
+     */
+    private void setChangeset(
+        int index, long value) {
+      ensureChangesetIsMutable();
+      changeset_.setLong(index, value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
+     */
+    private void addChangeset(long value) {
+      ensureChangesetIsMutable();
+      changeset_.addLong(value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
+     */
+    private void addAllChangeset(
+        java.lang.Iterable<? extends java.lang.Long> values) {
+      ensureChangesetIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, changeset_);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 changeset = 3 [packed = true];</code>
+     */
+    private void clearChangeset() {
+      changeset_ = emptyLongList();
+    }
 
     public static final int UID_FIELD_NUMBER = 4;
-    private java.util.List<java.lang.Integer> uid_;
+    private com.google.protobuf.Internal.IntList uid_;
     /**
-     * <code>repeated sint32 uid = 4 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
      */
     public java.util.List<java.lang.Integer>
         getUidList() {
       return uid_;
     }
     /**
-     * <code>repeated sint32 uid = 4 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
      */
     public int getUidCount() {
       return uid_.size();
     }
     /**
-     * <code>repeated sint32 uid = 4 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
      */
     public int getUid(int index) {
-      return uid_.get(index);
+      return uid_.getInt(index);
     }
     private int uidMemoizedSerializedSize = -1;
+    private void ensureUidIsMutable() {
+      if (!uid_.isModifiable()) {
+        uid_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(uid_);
+       }
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
+     */
+    private void setUid(
+        int index, int value) {
+      ensureUidIsMutable();
+      uid_.setInt(index, value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
+     */
+    private void addUid(int value) {
+      ensureUidIsMutable();
+      uid_.addInt(value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
+     */
+    private void addAllUid(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureUidIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, uid_);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 uid = 4 [packed = true];</code>
+     */
+    private void clearUid() {
+      uid_ = emptyIntList();
+    }
 
     public static final int USER_SID_FIELD_NUMBER = 5;
-    private java.util.List<java.lang.Integer> userSid_;
+    private com.google.protobuf.Internal.IntList userSid_;
     /**
-     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-     *
      * <pre>
      * String IDs for usernames. DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
      */
     public java.util.List<java.lang.Integer>
         getUserSidList() {
       return userSid_;
     }
     /**
-     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-     *
      * <pre>
      * String IDs for usernames. DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
      */
     public int getUserSidCount() {
       return userSid_.size();
     }
     /**
-     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-     *
      * <pre>
      * String IDs for usernames. DELTA coded
      * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
      */
     public int getUserSid(int index) {
-      return userSid_.get(index);
+      return userSid_.getInt(index);
     }
     private int userSidMemoizedSerializedSize = -1;
+    private void ensureUserSidIsMutable() {
+      if (!userSid_.isModifiable()) {
+        userSid_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(userSid_);
+       }
+    }
+    /**
+     * <pre>
+     * String IDs for usernames. DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
+     */
+    private void setUserSid(
+        int index, int value) {
+      ensureUserSidIsMutable();
+      userSid_.setInt(index, value);
+    }
+    /**
+     * <pre>
+     * String IDs for usernames. DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
+     */
+    private void addUserSid(int value) {
+      ensureUserSidIsMutable();
+      userSid_.addInt(value);
+    }
+    /**
+     * <pre>
+     * String IDs for usernames. DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
+     */
+    private void addAllUserSid(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureUserSidIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, userSid_);
+    }
+    /**
+     * <pre>
+     * String IDs for usernames. DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint32 user_sid = 5 [packed = true];</code>
+     */
+    private void clearUserSid() {
+      userSid_ = emptyIntList();
+    }
 
     public static final int VISIBLE_FIELD_NUMBER = 6;
-    private java.util.List<java.lang.Boolean> visible_;
+    private com.google.protobuf.Internal.BooleanList visible_;
     /**
-     * <code>repeated bool visible = 6 [packed = true];</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -6446,14 +6430,14 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
      */
     public java.util.List<java.lang.Boolean>
         getVisibleList() {
       return visible_;
     }
     /**
-     * <code>repeated bool visible = 6 [packed = true];</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -6464,13 +6448,13 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
      */
     public int getVisibleCount() {
       return visible_.size();
     }
     /**
-     * <code>repeated bool visible = 6 [packed = true];</code>
-     *
      * <pre>
      * The visible flag is used to store history information. It indicates that
      * the current object version has been created by a delete operation on the
@@ -6481,79 +6465,142 @@ public final class Osmformat {
      * true if the file has the required_features tag "HistoricalInformation"
      * set.
      * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
      */
     public boolean getVisible(int index) {
-      return visible_.get(index);
+      return visible_.getBoolean(index);
     }
     private int visibleMemoizedSerializedSize = -1;
-
-    private void initFields() {
-      version_ = java.util.Collections.emptyList();
-      timestamp_ = java.util.Collections.emptyList();
-      changeset_ = java.util.Collections.emptyList();
-      uid_ = java.util.Collections.emptyList();
-      userSid_ = java.util.Collections.emptyList();
-      visible_ = java.util.Collections.emptyList();
+    private void ensureVisibleIsMutable() {
+      if (!visible_.isModifiable()) {
+        visible_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(visible_);
+       }
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <pre>
+     * The visible flag is used to store history information. It indicates that
+     * the current object version has been created by a delete operation on the
+     * OSM API.
+     * When a writer sets this flag, it MUST add a required_features tag with
+     * value "HistoricalInformation" to the HeaderBlock.
+     * If this flag is not available for some object it MUST be assumed to be
+     * true if the file has the required_features tag "HistoricalInformation"
+     * set.
+     * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
+     */
+    private void setVisible(
+        int index, boolean value) {
+      ensureVisibleIsMutable();
+      visible_.setBoolean(index, value);
+    }
+    /**
+     * <pre>
+     * The visible flag is used to store history information. It indicates that
+     * the current object version has been created by a delete operation on the
+     * OSM API.
+     * When a writer sets this flag, it MUST add a required_features tag with
+     * value "HistoricalInformation" to the HeaderBlock.
+     * If this flag is not available for some object it MUST be assumed to be
+     * true if the file has the required_features tag "HistoricalInformation"
+     * set.
+     * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
+     */
+    private void addVisible(boolean value) {
+      ensureVisibleIsMutable();
+      visible_.addBoolean(value);
+    }
+    /**
+     * <pre>
+     * The visible flag is used to store history information. It indicates that
+     * the current object version has been created by a delete operation on the
+     * OSM API.
+     * When a writer sets this flag, it MUST add a required_features tag with
+     * value "HistoricalInformation" to the HeaderBlock.
+     * If this flag is not available for some object it MUST be assumed to be
+     * true if the file has the required_features tag "HistoricalInformation"
+     * set.
+     * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
+     */
+    private void addAllVisible(
+        java.lang.Iterable<? extends java.lang.Boolean> values) {
+      ensureVisibleIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, visible_);
+    }
+    /**
+     * <pre>
+     * The visible flag is used to store history information. It indicates that
+     * the current object version has been created by a delete operation on the
+     * OSM API.
+     * When a writer sets this flag, it MUST add a required_features tag with
+     * value "HistoricalInformation" to the HeaderBlock.
+     * If this flag is not available for some object it MUST be assumed to be
+     * true if the file has the required_features tag "HistoricalInformation"
+     * set.
+     * </pre>
+     *
+     * <code>repeated bool visible = 6 [packed = true];</code>
+     */
+    private void clearVisible() {
+      visible_ = emptyBooleanList();
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
       if (getVersionList().size() > 0) {
-        output.writeRawVarint32(10);
-        output.writeRawVarint32(versionMemoizedSerializedSize);
+        output.writeUInt32NoTag(10);
+        output.writeUInt32NoTag(versionMemoizedSerializedSize);
       }
       for (int i = 0; i < version_.size(); i++) {
-        output.writeInt32NoTag(version_.get(i));
+        output.writeInt32NoTag(version_.getInt(i));
       }
       if (getTimestampList().size() > 0) {
-        output.writeRawVarint32(18);
-        output.writeRawVarint32(timestampMemoizedSerializedSize);
+        output.writeUInt32NoTag(18);
+        output.writeUInt32NoTag(timestampMemoizedSerializedSize);
       }
       for (int i = 0; i < timestamp_.size(); i++) {
-        output.writeSInt64NoTag(timestamp_.get(i));
+        output.writeSInt64NoTag(timestamp_.getLong(i));
       }
       if (getChangesetList().size() > 0) {
-        output.writeRawVarint32(26);
-        output.writeRawVarint32(changesetMemoizedSerializedSize);
+        output.writeUInt32NoTag(26);
+        output.writeUInt32NoTag(changesetMemoizedSerializedSize);
       }
       for (int i = 0; i < changeset_.size(); i++) {
-        output.writeSInt64NoTag(changeset_.get(i));
+        output.writeSInt64NoTag(changeset_.getLong(i));
       }
       if (getUidList().size() > 0) {
-        output.writeRawVarint32(34);
-        output.writeRawVarint32(uidMemoizedSerializedSize);
+        output.writeUInt32NoTag(34);
+        output.writeUInt32NoTag(uidMemoizedSerializedSize);
       }
       for (int i = 0; i < uid_.size(); i++) {
-        output.writeSInt32NoTag(uid_.get(i));
+        output.writeSInt32NoTag(uid_.getInt(i));
       }
       if (getUserSidList().size() > 0) {
-        output.writeRawVarint32(42);
-        output.writeRawVarint32(userSidMemoizedSerializedSize);
+        output.writeUInt32NoTag(42);
+        output.writeUInt32NoTag(userSidMemoizedSerializedSize);
       }
       for (int i = 0; i < userSid_.size(); i++) {
-        output.writeSInt32NoTag(userSid_.get(i));
+        output.writeSInt32NoTag(userSid_.getInt(i));
       }
       if (getVisibleList().size() > 0) {
-        output.writeRawVarint32(50);
-        output.writeRawVarint32(visibleMemoizedSerializedSize);
+        output.writeUInt32NoTag(50);
+        output.writeUInt32NoTag(visibleMemoizedSerializedSize);
       }
       for (int i = 0; i < visible_.size(); i++) {
-        output.writeBoolNoTag(visible_.get(i));
+        output.writeBoolNoTag(visible_.getBoolean(i));
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -6563,7 +6610,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < version_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeInt32SizeNoTag(version_.get(i));
+            .computeInt32SizeNoTag(version_.getInt(i));
         }
         size += dataSize;
         if (!getVersionList().isEmpty()) {
@@ -6577,7 +6624,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < timestamp_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt64SizeNoTag(timestamp_.get(i));
+            .computeSInt64SizeNoTag(timestamp_.getLong(i));
         }
         size += dataSize;
         if (!getTimestampList().isEmpty()) {
@@ -6591,7 +6638,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < changeset_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt64SizeNoTag(changeset_.get(i));
+            .computeSInt64SizeNoTag(changeset_.getLong(i));
         }
         size += dataSize;
         if (!getChangesetList().isEmpty()) {
@@ -6605,7 +6652,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < uid_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt32SizeNoTag(uid_.get(i));
+            .computeSInt32SizeNoTag(uid_.getInt(i));
         }
         size += dataSize;
         if (!getUidList().isEmpty()) {
@@ -6619,7 +6666,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < userSid_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt32SizeNoTag(userSid_.get(i));
+            .computeSInt32SizeNoTag(userSid_.getInt(i));
         }
         size += dataSize;
         if (!getUserSidList().isEmpty()) {
@@ -6640,304 +6687,132 @@ public final class Osmformat {
         }
         visibleMemoizedSerializedSize = dataSize;
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
-     * Protobuf type {@code OSMPBF.DenseInfo}
-     *
      * <pre>
      ** Optional metadata that may be included into each primitive. Special dense format used in DenseNodes. 
      * </pre>
+     *
+     * Protobuf type {@code OSMPBF.DenseInfo}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.DenseInfo)
         org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfoOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        version_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        timestamp_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        changeset_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        uid_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        userSid_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        visible_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000020);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo result = new org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo(this);
-        int from_bitField0_ = bitField0_;
-        if (((bitField0_ & 0x00000001) == 0x00000001)) {
-          version_ = java.util.Collections.unmodifiableList(version_);
-          bitField0_ = (bitField0_ & ~0x00000001);
-        }
-        result.version_ = version_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          timestamp_ = java.util.Collections.unmodifiableList(timestamp_);
-          bitField0_ = (bitField0_ & ~0x00000002);
-        }
-        result.timestamp_ = timestamp_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          changeset_ = java.util.Collections.unmodifiableList(changeset_);
-          bitField0_ = (bitField0_ & ~0x00000004);
-        }
-        result.changeset_ = changeset_;
-        if (((bitField0_ & 0x00000008) == 0x00000008)) {
-          uid_ = java.util.Collections.unmodifiableList(uid_);
-          bitField0_ = (bitField0_ & ~0x00000008);
-        }
-        result.uid_ = uid_;
-        if (((bitField0_ & 0x00000010) == 0x00000010)) {
-          userSid_ = java.util.Collections.unmodifiableList(userSid_);
-          bitField0_ = (bitField0_ & ~0x00000010);
-        }
-        result.userSid_ = userSid_;
-        if (((bitField0_ & 0x00000020) == 0x00000020)) {
-          visible_ = java.util.Collections.unmodifiableList(visible_);
-          bitField0_ = (bitField0_ & ~0x00000020);
-        }
-        result.visible_ = visible_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance()) return this;
-        if (!other.version_.isEmpty()) {
-          if (version_.isEmpty()) {
-            version_ = other.version_;
-            bitField0_ = (bitField0_ & ~0x00000001);
-          } else {
-            ensureVersionIsMutable();
-            version_.addAll(other.version_);
-          }
-          
-        }
-        if (!other.timestamp_.isEmpty()) {
-          if (timestamp_.isEmpty()) {
-            timestamp_ = other.timestamp_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensureTimestampIsMutable();
-            timestamp_.addAll(other.timestamp_);
-          }
-          
-        }
-        if (!other.changeset_.isEmpty()) {
-          if (changeset_.isEmpty()) {
-            changeset_ = other.changeset_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureChangesetIsMutable();
-            changeset_.addAll(other.changeset_);
-          }
-          
-        }
-        if (!other.uid_.isEmpty()) {
-          if (uid_.isEmpty()) {
-            uid_ = other.uid_;
-            bitField0_ = (bitField0_ & ~0x00000008);
-          } else {
-            ensureUidIsMutable();
-            uid_.addAll(other.uid_);
-          }
-          
-        }
-        if (!other.userSid_.isEmpty()) {
-          if (userSid_.isEmpty()) {
-            userSid_ = other.userSid_;
-            bitField0_ = (bitField0_ & ~0x00000010);
-          } else {
-            ensureUserSidIsMutable();
-            userSid_.addAll(other.userSid_);
-          }
-          
-        }
-        if (!other.visible_.isEmpty()) {
-          if (visible_.isEmpty()) {
-            visible_ = other.visible_;
-            bitField0_ = (bitField0_ & ~0x00000020);
-          } else {
-            ensureVisibleIsMutable();
-            visible_.addAll(other.visible_);
-          }
-          
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        return true;
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private java.util.List<java.lang.Integer> version_ = java.util.Collections.emptyList();
-      private void ensureVersionIsMutable() {
-        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
-          version_ = new java.util.ArrayList<java.lang.Integer>(version_);
-          bitField0_ |= 0x00000001;
-         }
-      }
       /**
        * <code>repeated int32 version = 1 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getVersionList() {
-        return java.util.Collections.unmodifiableList(version_);
+        return java.util.Collections.unmodifiableList(
+            instance.getVersionList());
       }
       /**
        * <code>repeated int32 version = 1 [packed = true];</code>
        */
       public int getVersionCount() {
-        return version_.size();
+        return instance.getVersionCount();
       }
       /**
        * <code>repeated int32 version = 1 [packed = true];</code>
        */
       public int getVersion(int index) {
-        return version_.get(index);
+        return instance.getVersion(index);
       }
       /**
        * <code>repeated int32 version = 1 [packed = true];</code>
        */
       public Builder setVersion(
           int index, int value) {
-        ensureVersionIsMutable();
-        version_.set(index, value);
-        
+        copyOnWrite();
+        instance.setVersion(index, value);
         return this;
       }
       /**
        * <code>repeated int32 version = 1 [packed = true];</code>
        */
       public Builder addVersion(int value) {
-        ensureVersionIsMutable();
-        version_.add(value);
-        
+        copyOnWrite();
+        instance.addVersion(value);
         return this;
       }
       /**
@@ -6945,408 +6820,352 @@ public final class Osmformat {
        */
       public Builder addAllVersion(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureVersionIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, version_);
-        
+        copyOnWrite();
+        instance.addAllVersion(values);
         return this;
       }
       /**
        * <code>repeated int32 version = 1 [packed = true];</code>
        */
       public Builder clearVersion() {
-        version_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        
+        copyOnWrite();
+        instance.clearVersion();
         return this;
       }
 
-      private java.util.List<java.lang.Long> timestamp_ = java.util.Collections.emptyList();
-      private void ensureTimestampIsMutable() {
-        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          timestamp_ = new java.util.ArrayList<java.lang.Long>(timestamp_);
-          bitField0_ |= 0x00000002;
-         }
-      }
       /**
-       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
        */
       public java.util.List<java.lang.Long>
           getTimestampList() {
-        return java.util.Collections.unmodifiableList(timestamp_);
+        return java.util.Collections.unmodifiableList(
+            instance.getTimestampList());
       }
       /**
-       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
        */
       public int getTimestampCount() {
-        return timestamp_.size();
+        return instance.getTimestampCount();
       }
       /**
-       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
        */
       public long getTimestamp(int index) {
-        return timestamp_.get(index);
+        return instance.getTimestamp(index);
       }
       /**
-       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
        */
       public Builder setTimestamp(
           int index, long value) {
-        ensureTimestampIsMutable();
-        timestamp_.set(index, value);
-        
+        copyOnWrite();
+        instance.setTimestamp(index, value);
         return this;
       }
       /**
-       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
        */
       public Builder addTimestamp(long value) {
-        ensureTimestampIsMutable();
-        timestamp_.add(value);
-        
+        copyOnWrite();
+        instance.addTimestamp(value);
         return this;
       }
       /**
-       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
        */
       public Builder addAllTimestamp(
           java.lang.Iterable<? extends java.lang.Long> values) {
-        ensureTimestampIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, timestamp_);
-        
+        copyOnWrite();
+        instance.addAllTimestamp(values);
         return this;
       }
       /**
-       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 timestamp = 2 [packed = true];</code>
        */
       public Builder clearTimestamp() {
-        timestamp_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        
+        copyOnWrite();
+        instance.clearTimestamp();
         return this;
       }
 
-      private java.util.List<java.lang.Long> changeset_ = java.util.Collections.emptyList();
-      private void ensureChangesetIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          changeset_ = new java.util.ArrayList<java.lang.Long>(changeset_);
-          bitField0_ |= 0x00000004;
-         }
-      }
       /**
-       * <code>repeated sint64 changeset = 3 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 changeset = 3 [packed = true];</code>
        */
       public java.util.List<java.lang.Long>
           getChangesetList() {
-        return java.util.Collections.unmodifiableList(changeset_);
+        return java.util.Collections.unmodifiableList(
+            instance.getChangesetList());
       }
       /**
-       * <code>repeated sint64 changeset = 3 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 changeset = 3 [packed = true];</code>
        */
       public int getChangesetCount() {
-        return changeset_.size();
+        return instance.getChangesetCount();
       }
       /**
-       * <code>repeated sint64 changeset = 3 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 changeset = 3 [packed = true];</code>
        */
       public long getChangeset(int index) {
-        return changeset_.get(index);
+        return instance.getChangeset(index);
       }
       /**
-       * <code>repeated sint64 changeset = 3 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 changeset = 3 [packed = true];</code>
        */
       public Builder setChangeset(
           int index, long value) {
-        ensureChangesetIsMutable();
-        changeset_.set(index, value);
-        
+        copyOnWrite();
+        instance.setChangeset(index, value);
         return this;
       }
       /**
-       * <code>repeated sint64 changeset = 3 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 changeset = 3 [packed = true];</code>
        */
       public Builder addChangeset(long value) {
-        ensureChangesetIsMutable();
-        changeset_.add(value);
-        
+        copyOnWrite();
+        instance.addChangeset(value);
         return this;
       }
       /**
-       * <code>repeated sint64 changeset = 3 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 changeset = 3 [packed = true];</code>
        */
       public Builder addAllChangeset(
           java.lang.Iterable<? extends java.lang.Long> values) {
-        ensureChangesetIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, changeset_);
-        
+        copyOnWrite();
+        instance.addAllChangeset(values);
         return this;
       }
       /**
-       * <code>repeated sint64 changeset = 3 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 changeset = 3 [packed = true];</code>
        */
       public Builder clearChangeset() {
-        changeset_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        
+        copyOnWrite();
+        instance.clearChangeset();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> uid_ = java.util.Collections.emptyList();
-      private void ensureUidIsMutable() {
-        if (!((bitField0_ & 0x00000008) == 0x00000008)) {
-          uid_ = new java.util.ArrayList<java.lang.Integer>(uid_);
-          bitField0_ |= 0x00000008;
-         }
-      }
       /**
-       * <code>repeated sint32 uid = 4 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 uid = 4 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getUidList() {
-        return java.util.Collections.unmodifiableList(uid_);
+        return java.util.Collections.unmodifiableList(
+            instance.getUidList());
       }
       /**
-       * <code>repeated sint32 uid = 4 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 uid = 4 [packed = true];</code>
        */
       public int getUidCount() {
-        return uid_.size();
+        return instance.getUidCount();
       }
       /**
-       * <code>repeated sint32 uid = 4 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 uid = 4 [packed = true];</code>
        */
       public int getUid(int index) {
-        return uid_.get(index);
+        return instance.getUid(index);
       }
       /**
-       * <code>repeated sint32 uid = 4 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 uid = 4 [packed = true];</code>
        */
       public Builder setUid(
           int index, int value) {
-        ensureUidIsMutable();
-        uid_.set(index, value);
-        
+        copyOnWrite();
+        instance.setUid(index, value);
         return this;
       }
       /**
-       * <code>repeated sint32 uid = 4 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 uid = 4 [packed = true];</code>
        */
       public Builder addUid(int value) {
-        ensureUidIsMutable();
-        uid_.add(value);
-        
+        copyOnWrite();
+        instance.addUid(value);
         return this;
       }
       /**
-       * <code>repeated sint32 uid = 4 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 uid = 4 [packed = true];</code>
        */
       public Builder addAllUid(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureUidIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, uid_);
-        
+        copyOnWrite();
+        instance.addAllUid(values);
         return this;
       }
       /**
-       * <code>repeated sint32 uid = 4 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 uid = 4 [packed = true];</code>
        */
       public Builder clearUid() {
-        uid_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        
+        copyOnWrite();
+        instance.clearUid();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> userSid_ = java.util.Collections.emptyList();
-      private void ensureUserSidIsMutable() {
-        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
-          userSid_ = new java.util.ArrayList<java.lang.Integer>(userSid_);
-          bitField0_ |= 0x00000010;
-         }
-      }
       /**
-       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-       *
        * <pre>
        * String IDs for usernames. DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getUserSidList() {
-        return java.util.Collections.unmodifiableList(userSid_);
+        return java.util.Collections.unmodifiableList(
+            instance.getUserSidList());
       }
       /**
-       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-       *
        * <pre>
        * String IDs for usernames. DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
        */
       public int getUserSidCount() {
-        return userSid_.size();
+        return instance.getUserSidCount();
       }
       /**
-       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-       *
        * <pre>
        * String IDs for usernames. DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
        */
       public int getUserSid(int index) {
-        return userSid_.get(index);
+        return instance.getUserSid(index);
       }
       /**
-       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-       *
        * <pre>
        * String IDs for usernames. DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
        */
       public Builder setUserSid(
           int index, int value) {
-        ensureUserSidIsMutable();
-        userSid_.set(index, value);
-        
+        copyOnWrite();
+        instance.setUserSid(index, value);
         return this;
       }
       /**
-       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-       *
        * <pre>
        * String IDs for usernames. DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
        */
       public Builder addUserSid(int value) {
-        ensureUserSidIsMutable();
-        userSid_.add(value);
-        
+        copyOnWrite();
+        instance.addUserSid(value);
         return this;
       }
       /**
-       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-       *
        * <pre>
        * String IDs for usernames. DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
        */
       public Builder addAllUserSid(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureUserSidIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, userSid_);
-        
+        copyOnWrite();
+        instance.addAllUserSid(values);
         return this;
       }
       /**
-       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
-       *
        * <pre>
        * String IDs for usernames. DELTA coded
        * </pre>
+       *
+       * <code>repeated sint32 user_sid = 5 [packed = true];</code>
        */
       public Builder clearUserSid() {
-        userSid_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        
+        copyOnWrite();
+        instance.clearUserSid();
         return this;
       }
 
-      private java.util.List<java.lang.Boolean> visible_ = java.util.Collections.emptyList();
-      private void ensureVisibleIsMutable() {
-        if (!((bitField0_ & 0x00000020) == 0x00000020)) {
-          visible_ = new java.util.ArrayList<java.lang.Boolean>(visible_);
-          bitField0_ |= 0x00000020;
-         }
-      }
       /**
-       * <code>repeated bool visible = 6 [packed = true];</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -7357,14 +7176,15 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>repeated bool visible = 6 [packed = true];</code>
        */
       public java.util.List<java.lang.Boolean>
           getVisibleList() {
-        return java.util.Collections.unmodifiableList(visible_);
+        return java.util.Collections.unmodifiableList(
+            instance.getVisibleList());
       }
       /**
-       * <code>repeated bool visible = 6 [packed = true];</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -7375,13 +7195,13 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>repeated bool visible = 6 [packed = true];</code>
        */
       public int getVisibleCount() {
-        return visible_.size();
+        return instance.getVisibleCount();
       }
       /**
-       * <code>repeated bool visible = 6 [packed = true];</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -7392,13 +7212,13 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>repeated bool visible = 6 [packed = true];</code>
        */
       public boolean getVisible(int index) {
-        return visible_.get(index);
+        return instance.getVisible(index);
       }
       /**
-       * <code>repeated bool visible = 6 [packed = true];</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -7409,17 +7229,16 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>repeated bool visible = 6 [packed = true];</code>
        */
       public Builder setVisible(
           int index, boolean value) {
-        ensureVisibleIsMutable();
-        visible_.set(index, value);
-        
+        copyOnWrite();
+        instance.setVisible(index, value);
         return this;
       }
       /**
-       * <code>repeated bool visible = 6 [packed = true];</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -7430,16 +7249,15 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>repeated bool visible = 6 [packed = true];</code>
        */
       public Builder addVisible(boolean value) {
-        ensureVisibleIsMutable();
-        visible_.add(value);
-        
+        copyOnWrite();
+        instance.addVisible(value);
         return this;
       }
       /**
-       * <code>repeated bool visible = 6 [packed = true];</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -7450,18 +7268,16 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>repeated bool visible = 6 [packed = true];</code>
        */
       public Builder addAllVisible(
           java.lang.Iterable<? extends java.lang.Boolean> values) {
-        ensureVisibleIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, visible_);
-        
+        copyOnWrite();
+        instance.addAllVisible(values);
         return this;
       }
       /**
-       * <code>repeated bool visible = 6 [packed = true];</code>
-       *
        * <pre>
        * The visible flag is used to store history information. It indicates that
        * the current object version has been created by a delete operation on the
@@ -7472,23 +7288,243 @@ public final class Osmformat {
        * true if the file has the required_features tag "HistoricalInformation"
        * set.
        * </pre>
+       *
+       * <code>repeated bool visible = 6 [packed = true];</code>
        */
       public Builder clearVisible() {
-        visible_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000020);
-        
+        copyOnWrite();
+        instance.clearVisible();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.DenseInfo)
     }
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo();
+        }
+        case IS_INITIALIZED: {
+          return DEFAULT_INSTANCE;
+        }
+        case MAKE_IMMUTABLE: {
+          version_.makeImmutable();
+          timestamp_.makeImmutable();
+          changeset_.makeImmutable();
+          uid_.makeImmutable();
+          userSid_.makeImmutable();
+          visible_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo other = (org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo) arg1;
+          version_= visitor.visitIntList(version_, other.version_);
+          timestamp_= visitor.visitLongList(timestamp_, other.timestamp_);
+          changeset_= visitor.visitLongList(changeset_, other.changeset_);
+          uid_= visitor.visitIntList(uid_, other.uid_);
+          userSid_= visitor.visitIntList(userSid_, other.userSid_);
+          visible_= visitor.visitBooleanList(visible_, other.visible_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  if (!version_.isModifiable()) {
+                    version_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(version_);
+                  }
+                  version_.addInt(input.readInt32());
+                  break;
+                }
+                case 10: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!version_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    version_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(version_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    version_.addInt(input.readInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 16: {
+                  if (!timestamp_.isModifiable()) {
+                    timestamp_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(timestamp_);
+                  }
+                  timestamp_.addLong(input.readSInt64());
+                  break;
+                }
+                case 18: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!timestamp_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    timestamp_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(timestamp_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    timestamp_.addLong(input.readSInt64());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 24: {
+                  if (!changeset_.isModifiable()) {
+                    changeset_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(changeset_);
+                  }
+                  changeset_.addLong(input.readSInt64());
+                  break;
+                }
+                case 26: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!changeset_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    changeset_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(changeset_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    changeset_.addLong(input.readSInt64());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 32: {
+                  if (!uid_.isModifiable()) {
+                    uid_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(uid_);
+                  }
+                  uid_.addInt(input.readSInt32());
+                  break;
+                }
+                case 34: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!uid_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    uid_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(uid_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    uid_.addInt(input.readSInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 40: {
+                  if (!userSid_.isModifiable()) {
+                    userSid_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(userSid_);
+                  }
+                  userSid_.addInt(input.readSInt32());
+                  break;
+                }
+                case 42: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!userSid_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    userSid_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(userSid_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    userSid_.addInt(input.readSInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 48: {
+                  if (!visible_.isModifiable()) {
+                    visible_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(visible_);
+                  }
+                  visible_.addBoolean(input.readBool());
+                  break;
+                }
+                case 50: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!visible_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    final int currentSize = visible_.size();
+                    visible_ = visible_.mutableCopyWithCapacity(
+                        currentSize + (length/1));
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    visible_.addBoolean(input.readBool());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
+
 
+    // @@protoc_insertion_point(class_scope:OSMPBF.DenseInfo)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo DEFAULT_INSTANCE;
     static {
-      defaultInstance = new DenseInfo(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new DenseInfo();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.DenseInfo)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<DenseInfo> PARSER;
+
+    public static com.google.protobuf.Parser<DenseInfo> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface ChangeSetOrBuilder extends
@@ -7496,8 +7532,6 @@ public final class Osmformat {
       com.google.protobuf.MessageLiteOrBuilder {
 
     /**
-     * <code>required int64 id = 1;</code>
-     *
      * <pre>
      *   
      *   // Parallel arrays.
@@ -7505,11 +7539,11 @@ public final class Osmformat {
      *   repeated uint32 vals = 3 [packed = true]; // String IDs.
      *   optional Info info = 4;
      * </pre>
+     *
+     * <code>required int64 id = 1;</code>
      */
     boolean hasId();
     /**
-     * <code>required int64 id = 1;</code>
-     *
      * <pre>
      *   
      *   // Parallel arrays.
@@ -7517,108 +7551,30 @@ public final class Osmformat {
      *   repeated uint32 vals = 3 [packed = true]; // String IDs.
      *   optional Info info = 4;
      * </pre>
+     *
+     * <code>required int64 id = 1;</code>
      */
     long getId();
   }
   /**
-   * Protobuf type {@code OSMPBF.ChangeSet}
-   *
    * <pre>
    * THIS IS STUB DESIGN FOR CHANGESETS. NOT USED RIGHT NOW.
    * TODO:    REMOVE THIS?
    * </pre>
+   *
+   * Protobuf type {@code OSMPBF.ChangeSet}
    */
-  public static final class ChangeSet extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class ChangeSet extends
+      com.google.protobuf.GeneratedMessageLite<
+          ChangeSet, ChangeSet.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.ChangeSet)
       ChangeSetOrBuilder {
-    // Use ChangeSet.newBuilder() to construct.
-    private ChangeSet(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
+    private ChangeSet() {
     }
-    private ChangeSet(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final ChangeSet defaultInstance;
-    public static ChangeSet getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public ChangeSet getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private ChangeSet(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              bitField0_ |= 0x00000001;
-              id_ = input.readInt64();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<ChangeSet> PARSER =
-        new com.google.protobuf.AbstractParser<ChangeSet>() {
-      public ChangeSet parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new ChangeSet(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<ChangeSet> getParserForType() {
-      return PARSER;
-    }
-
     private int bitField0_;
     public static final int ID_FIELD_NUMBER = 1;
     private long id_;
     /**
-     * <code>required int64 id = 1;</code>
-     *
      * <pre>
      *   
      *   // Parallel arrays.
@@ -7626,13 +7582,13 @@ public final class Osmformat {
      *   repeated uint32 vals = 3 [packed = true]; // String IDs.
      *   optional Info info = 4;
      * </pre>
+     *
+     * <code>required int64 id = 1;</code>
      */
     public boolean hasId() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
-     * <code>required int64 id = 1;</code>
-     *
      * <pre>
      *   
      *   // Parallel arrays.
@@ -7640,38 +7596,51 @@ public final class Osmformat {
      *   repeated uint32 vals = 3 [packed = true]; // String IDs.
      *   optional Info info = 4;
      * </pre>
+     *
+     * <code>required int64 id = 1;</code>
      */
     public long getId() {
       return id_;
     }
-
-    private void initFields() {
-      id_ = 0L;
+    /**
+     * <pre>
+     *   
+     *   // Parallel arrays.
+     *   repeated uint32 keys = 2 [packed = true]; // String IDs.
+     *   repeated uint32 vals = 3 [packed = true]; // String IDs.
+     *   optional Info info = 4;
+     * </pre>
+     *
+     * <code>required int64 id = 1;</code>
+     */
+    private void setId(long value) {
+      bitField0_ |= 0x00000001;
+      id_ = value;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      if (!hasId()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <pre>
+     *   
+     *   // Parallel arrays.
+     *   repeated uint32 keys = 2 [packed = true]; // String IDs.
+     *   repeated uint32 vals = 3 [packed = true]; // String IDs.
+     *   optional Info info = 4;
+     * </pre>
+     *
+     * <code>required int64 id = 1;</code>
+     */
+    private void clearId() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      id_ = 0L;
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         output.writeInt64(1, id_);
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -7681,179 +7650,99 @@ public final class Osmformat {
         size += com.google.protobuf.CodedOutputStream
           .computeInt64Size(1, id_);
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
-     * Protobuf type {@code OSMPBF.ChangeSet}
-     *
      * <pre>
      * THIS IS STUB DESIGN FOR CHANGESETS. NOT USED RIGHT NOW.
      * TODO:    REMOVE THIS?
      * </pre>
+     *
+     * Protobuf type {@code OSMPBF.ChangeSet}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.ChangeSet)
         org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSetOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
+        super(DEFAULT_INSTANCE);
       }
 
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        id_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet result = new org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.id_ = id_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.getDefaultInstance()) return this;
-        if (other.hasId()) {
-          setId(other.getId());
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        if (!hasId()) {
-          
-          return false;
-        }
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private long id_ ;
       /**
-       * <code>required int64 id = 1;</code>
-       *
        * <pre>
        *   
        *   // Parallel arrays.
@@ -7861,13 +7750,13 @@ public final class Osmformat {
        *   repeated uint32 vals = 3 [packed = true]; // String IDs.
        *   optional Info info = 4;
        * </pre>
+       *
+       * <code>required int64 id = 1;</code>
        */
       public boolean hasId() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasId();
       }
       /**
-       * <code>required int64 id = 1;</code>
-       *
        * <pre>
        *   
        *   // Parallel arrays.
@@ -7875,13 +7764,13 @@ public final class Osmformat {
        *   repeated uint32 vals = 3 [packed = true]; // String IDs.
        *   optional Info info = 4;
        * </pre>
+       *
+       * <code>required int64 id = 1;</code>
        */
       public long getId() {
-        return id_;
+        return instance.getId();
       }
       /**
-       * <code>required int64 id = 1;</code>
-       *
        * <pre>
        *   
        *   // Parallel arrays.
@@ -7889,16 +7778,15 @@ public final class Osmformat {
        *   repeated uint32 vals = 3 [packed = true]; // String IDs.
        *   optional Info info = 4;
        * </pre>
+       *
+       * <code>required int64 id = 1;</code>
        */
       public Builder setId(long value) {
-        bitField0_ |= 0x00000001;
-        id_ = value;
-        
+        copyOnWrite();
+        instance.setId(value);
         return this;
       }
       /**
-       * <code>required int64 id = 1;</code>
-       *
        * <pre>
        *   
        *   // Parallel arrays.
@@ -7906,23 +7794,127 @@ public final class Osmformat {
        *   repeated uint32 vals = 3 [packed = true]; // String IDs.
        *   optional Info info = 4;
        * </pre>
+       *
+       * <code>required int64 id = 1;</code>
        */
       public Builder clearId() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        id_ = 0L;
-        
+        copyOnWrite();
+        instance.clearId();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.ChangeSet)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (!hasId()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
 
-    static {
-      defaultInstance = new ChangeSet(true);
-      defaultInstance.initFields();
+        }
+        case MAKE_IMMUTABLE: {
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet other = (org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet) arg1;
+          id_ = visitor.visitLong(
+              hasId(), id_,
+              other.hasId(), other.id_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  bitField0_ |= 0x00000001;
+                  id_ = input.readInt64();
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
     }
 
+
     // @@protoc_insertion_point(class_scope:OSMPBF.ChangeSet)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet DEFAULT_INSTANCE;
+    static {
+      DEFAULT_INSTANCE = new ChangeSet();
+      DEFAULT_INSTANCE.makeImmutable();
+    }
+
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.ChangeSet getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<ChangeSet> PARSER;
+
+    public static com.google.protobuf.Parser<ChangeSet> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface NodeOrBuilder extends
@@ -7939,69 +7931,69 @@ public final class Osmformat {
     long getId();
 
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getKeysList();
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     int getKeysCount();
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     int getKeys(int index);
 
     /**
-     * <code>repeated uint32 vals = 3 [packed = true];</code>
-     *
      * <pre>
      * String IDs.
      * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getValsList();
     /**
-     * <code>repeated uint32 vals = 3 [packed = true];</code>
-     *
      * <pre>
      * String IDs.
      * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     int getValsCount();
     /**
-     * <code>repeated uint32 vals = 3 [packed = true];</code>
-     *
      * <pre>
      * String IDs.
      * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     int getVals(int index);
 
     /**
-     * <code>optional .OSMPBF.Info info = 4;</code>
-     *
      * <pre>
      * May be omitted in omitmeta
      * </pre>
+     *
+     * <code>optional .OSMPBF.Info info = 4;</code>
      */
     boolean hasInfo();
     /**
-     * <code>optional .OSMPBF.Info info = 4;</code>
-     *
      * <pre>
      * May be omitted in omitmeta
      * </pre>
+     *
+     * <code>optional .OSMPBF.Info info = 4;</code>
      */
     org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo();
 
@@ -8026,162 +8018,15 @@ public final class Osmformat {
   /**
    * Protobuf type {@code OSMPBF.Node}
    */
-  public static final class Node extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class Node extends
+      com.google.protobuf.GeneratedMessageLite<
+          Node, Node.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.Node)
       NodeOrBuilder {
-    // Use Node.newBuilder() to construct.
-    private Node(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private Node(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final Node defaultInstance;
-    public static Node getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public Node getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private Node(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              bitField0_ |= 0x00000001;
-              id_ = input.readSInt64();
-              break;
-            }
-            case 16: {
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                keys_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              keys_.add(input.readUInt32());
-              break;
-            }
-            case 18: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
-                keys_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                keys_.add(input.readUInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 24: {
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                vals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              vals_.add(input.readUInt32());
-              break;
-            }
-            case 26: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
-                vals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                vals_.add(input.readUInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 34: {
-              org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000002) == 0x00000002)) {
-                subBuilder = info_.toBuilder();
-              }
-              info_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Info.PARSER, extensionRegistry);
-              if (subBuilder != null) {
-                subBuilder.mergeFrom(info_);
-                info_ = subBuilder.buildPartial();
-              }
-              bitField0_ |= 0x00000002;
-              break;
-            }
-            case 64: {
-              bitField0_ |= 0x00000004;
-              lat_ = input.readSInt64();
-              break;
-            }
-            case 72: {
-              bitField0_ |= 0x00000008;
-              lon_ = input.readSInt64();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = java.util.Collections.unmodifiableList(keys_);
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = java.util.Collections.unmodifiableList(vals_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<Node> PARSER =
-        new com.google.protobuf.AbstractParser<Node>() {
-      public Node parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new Node(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<Node> getParserForType() {
-      return PARSER;
+    private Node() {
+      keys_ = emptyIntList();
+      vals_ = emptyIntList();
     }
-
     private int bitField0_;
     public static final int ID_FIELD_NUMBER = 1;
     private long id_;
@@ -8197,98 +8042,269 @@ public final class Osmformat {
     public long getId() {
       return id_;
     }
-
-    public static final int KEYS_FIELD_NUMBER = 2;
-    private java.util.List<java.lang.Integer> keys_;
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
+     * <code>required sint64 id = 1;</code>
+     */
+    private void setId(long value) {
+      bitField0_ |= 0x00000001;
+      id_ = value;
+    }
+    /**
+     * <code>required sint64 id = 1;</code>
+     */
+    private void clearId() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      id_ = 0L;
+    }
+
+    public static final int KEYS_FIELD_NUMBER = 2;
+    private com.google.protobuf.Internal.IntList keys_;
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    public java.util.List<java.lang.Integer>
+        getKeysList() {
+      return keys_;
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    public int getKeysCount() {
+      return keys_.size();
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    public int getKeys(int index) {
+      return keys_.getInt(index);
+    }
+    private int keysMemoizedSerializedSize = -1;
+    private void ensureKeysIsMutable() {
+      if (!keys_.isModifiable()) {
+        keys_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+       }
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void setKeys(
+        int index, int value) {
+      ensureKeysIsMutable();
+      keys_.setInt(index, value);
+    }
+    /**
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
-    public java.util.List<java.lang.Integer>
-        getKeysList() {
-      return keys_;
+    private void addKeys(int value) {
+      ensureKeysIsMutable();
+      keys_.addInt(value);
     }
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
-    public int getKeysCount() {
-      return keys_.size();
+    private void addAllKeys(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureKeysIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, keys_);
     }
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
-    public int getKeys(int index) {
-      return keys_.get(index);
+    private void clearKeys() {
+      keys_ = emptyIntList();
     }
-    private int keysMemoizedSerializedSize = -1;
 
     public static final int VALS_FIELD_NUMBER = 3;
-    private java.util.List<java.lang.Integer> vals_;
+    private com.google.protobuf.Internal.IntList vals_;
     /**
-     * <code>repeated uint32 vals = 3 [packed = true];</code>
-     *
      * <pre>
      * String IDs.
      * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     public java.util.List<java.lang.Integer>
         getValsList() {
       return vals_;
     }
     /**
-     * <code>repeated uint32 vals = 3 [packed = true];</code>
-     *
      * <pre>
      * String IDs.
      * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     public int getValsCount() {
       return vals_.size();
     }
     /**
-     * <code>repeated uint32 vals = 3 [packed = true];</code>
-     *
      * <pre>
      * String IDs.
      * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     public int getVals(int index) {
-      return vals_.get(index);
+      return vals_.getInt(index);
     }
     private int valsMemoizedSerializedSize = -1;
+    private void ensureValsIsMutable() {
+      if (!vals_.isModifiable()) {
+        vals_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+       }
+    }
+    /**
+     * <pre>
+     * String IDs.
+     * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void setVals(
+        int index, int value) {
+      ensureValsIsMutable();
+      vals_.setInt(index, value);
+    }
+    /**
+     * <pre>
+     * String IDs.
+     * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void addVals(int value) {
+      ensureValsIsMutable();
+      vals_.addInt(value);
+    }
+    /**
+     * <pre>
+     * String IDs.
+     * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void addAllVals(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureValsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, vals_);
+    }
+    /**
+     * <pre>
+     * String IDs.
+     * </pre>
+     *
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void clearVals() {
+      vals_ = emptyIntList();
+    }
 
     public static final int INFO_FIELD_NUMBER = 4;
     private org.openstreetmap.osmosis.osmbinary.Osmformat.Info info_;
     /**
-     * <code>optional .OSMPBF.Info info = 4;</code>
-     *
      * <pre>
      * May be omitted in omitmeta
      * </pre>
+     *
+     * <code>optional .OSMPBF.Info info = 4;</code>
      */
     public boolean hasInfo() {
       return ((bitField0_ & 0x00000002) == 0x00000002);
     }
     /**
+     * <pre>
+     * May be omitted in omitmeta
+     * </pre>
+     *
      * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo() {
+      return info_ == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance() : info_;
+    }
+    /**
+     * <pre>
+     * May be omitted in omitmeta
+     * </pre>
      *
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void setInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      info_ = value;
+      bitField0_ |= 0x00000002;
+      }
+    /**
      * <pre>
      * May be omitted in omitmeta
      * </pre>
+     *
+     * <code>optional .OSMPBF.Info info = 4;</code>
      */
-    public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo() {
-      return info_;
+    private void setInfo(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder builderForValue) {
+      info_ = builderForValue.build();
+      bitField0_ |= 0x00000002;
+    }
+    /**
+     * <pre>
+     * May be omitted in omitmeta
+     * </pre>
+     *
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void mergeInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
+      if (info_ != null &&
+          info_ != org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance()) {
+        info_ =
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Info.newBuilder(info_).mergeFrom(value).buildPartial();
+      } else {
+        info_ = value;
+      }
+      bitField0_ |= 0x00000002;
+    }
+    /**
+     * <pre>
+     * May be omitted in omitmeta
+     * </pre>
+     *
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void clearInfo() {  info_ = null;
+      bitField0_ = (bitField0_ & ~0x00000002);
     }
 
     public static final int LAT_FIELD_NUMBER = 8;
@@ -8305,6 +8321,20 @@ public final class Osmformat {
     public long getLat() {
       return lat_;
     }
+    /**
+     * <code>required sint64 lat = 8;</code>
+     */
+    private void setLat(long value) {
+      bitField0_ |= 0x00000004;
+      lat_ = value;
+    }
+    /**
+     * <code>required sint64 lat = 8;</code>
+     */
+    private void clearLat() {
+      bitField0_ = (bitField0_ & ~0x00000004);
+      lat_ = 0L;
+    }
 
     public static final int LON_FIELD_NUMBER = 9;
     private long lon_;
@@ -8320,35 +8350,19 @@ public final class Osmformat {
     public long getLon() {
       return lon_;
     }
-
-    private void initFields() {
-      id_ = 0L;
-      keys_ = java.util.Collections.emptyList();
-      vals_ = java.util.Collections.emptyList();
-      info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-      lat_ = 0L;
-      lon_ = 0L;
+    /**
+     * <code>required sint64 lon = 9;</code>
+     */
+    private void setLon(long value) {
+      bitField0_ |= 0x00000008;
+      lon_ = value;
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      if (!hasId()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      if (!hasLat()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      if (!hasLon()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <code>required sint64 lon = 9;</code>
+     */
+    private void clearLon() {
+      bitField0_ = (bitField0_ & ~0x00000008);
+      lon_ = 0L;
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
@@ -8358,21 +8372,21 @@ public final class Osmformat {
         output.writeSInt64(1, id_);
       }
       if (getKeysList().size() > 0) {
-        output.writeRawVarint32(18);
-        output.writeRawVarint32(keysMemoizedSerializedSize);
+        output.writeUInt32NoTag(18);
+        output.writeUInt32NoTag(keysMemoizedSerializedSize);
       }
       for (int i = 0; i < keys_.size(); i++) {
-        output.writeUInt32NoTag(keys_.get(i));
+        output.writeUInt32NoTag(keys_.getInt(i));
       }
       if (getValsList().size() > 0) {
-        output.writeRawVarint32(26);
-        output.writeRawVarint32(valsMemoizedSerializedSize);
+        output.writeUInt32NoTag(26);
+        output.writeUInt32NoTag(valsMemoizedSerializedSize);
       }
       for (int i = 0; i < vals_.size(); i++) {
-        output.writeUInt32NoTag(vals_.get(i));
+        output.writeUInt32NoTag(vals_.getInt(i));
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
-        output.writeMessage(4, info_);
+        output.writeMessage(4, getInfo());
       }
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         output.writeSInt64(8, lat_);
@@ -8380,10 +8394,9 @@ public final class Osmformat {
       if (((bitField0_ & 0x00000008) == 0x00000008)) {
         output.writeSInt64(9, lon_);
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -8397,7 +8410,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < keys_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeUInt32SizeNoTag(keys_.get(i));
+            .computeUInt32SizeNoTag(keys_.getInt(i));
         }
         size += dataSize;
         if (!getKeysList().isEmpty()) {
@@ -8411,7 +8424,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < vals_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeUInt32SizeNoTag(vals_.get(i));
+            .computeUInt32SizeNoTag(vals_.getInt(i));
         }
         size += dataSize;
         if (!getValsList().isEmpty()) {
@@ -8423,7 +8436,7 @@ public final class Osmformat {
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(4, info_);
+          .computeMessageSize(4, getInfo());
       }
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         size += com.google.protobuf.CodedOutputStream
@@ -8433,616 +8446,615 @@ public final class Osmformat {
         size += com.google.protobuf.CodedOutputStream
           .computeSInt64Size(9, lon_);
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.Node prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.Node}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.Node, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Node, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.Node)
         org.openstreetmap.osmosis.osmbinary.Osmformat.NodeOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.Node.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        id_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        keys_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        vals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        lat_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000010);
-        lon_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000020);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Node getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.Node.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Node build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Node result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Node buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Node result = new org.openstreetmap.osmosis.osmbinary.Osmformat.Node(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.id_ = id_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = java.util.Collections.unmodifiableList(keys_);
-          bitField0_ = (bitField0_ & ~0x00000002);
-        }
-        result.keys_ = keys_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = java.util.Collections.unmodifiableList(vals_);
-          bitField0_ = (bitField0_ & ~0x00000004);
-        }
-        result.vals_ = vals_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.info_ = info_;
-        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
-          to_bitField0_ |= 0x00000004;
-        }
-        result.lat_ = lat_;
-        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
-          to_bitField0_ |= 0x00000008;
-        }
-        result.lon_ = lon_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.Node other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.Node.getDefaultInstance()) return this;
-        if (other.hasId()) {
-          setId(other.getId());
-        }
-        if (!other.keys_.isEmpty()) {
-          if (keys_.isEmpty()) {
-            keys_ = other.keys_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensureKeysIsMutable();
-            keys_.addAll(other.keys_);
-          }
-          
-        }
-        if (!other.vals_.isEmpty()) {
-          if (vals_.isEmpty()) {
-            vals_ = other.vals_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureValsIsMutable();
-            vals_.addAll(other.vals_);
-          }
-          
-        }
-        if (other.hasInfo()) {
-          mergeInfo(other.getInfo());
-        }
-        if (other.hasLat()) {
-          setLat(other.getLat());
-        }
-        if (other.hasLon()) {
-          setLon(other.getLon());
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        if (!hasId()) {
-          
-          return false;
-        }
-        if (!hasLat()) {
-          
-          return false;
-        }
-        if (!hasLon()) {
-          
-          return false;
-        }
-        return true;
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Node parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.Node) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private long id_ ;
       /**
        * <code>required sint64 id = 1;</code>
        */
       public boolean hasId() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasId();
       }
       /**
        * <code>required sint64 id = 1;</code>
        */
       public long getId() {
-        return id_;
+        return instance.getId();
       }
       /**
        * <code>required sint64 id = 1;</code>
        */
       public Builder setId(long value) {
-        bitField0_ |= 0x00000001;
-        id_ = value;
-        
+        copyOnWrite();
+        instance.setId(value);
         return this;
       }
       /**
        * <code>required sint64 id = 1;</code>
        */
       public Builder clearId() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        id_ = 0L;
-        
+        copyOnWrite();
+        instance.clearId();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> keys_ = java.util.Collections.emptyList();
-      private void ensureKeysIsMutable() {
-        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = new java.util.ArrayList<java.lang.Integer>(keys_);
-          bitField0_ |= 0x00000002;
-         }
-      }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getKeysList() {
-        return java.util.Collections.unmodifiableList(keys_);
+        return java.util.Collections.unmodifiableList(
+            instance.getKeysList());
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public int getKeysCount() {
-        return keys_.size();
+        return instance.getKeysCount();
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public int getKeys(int index) {
-        return keys_.get(index);
+        return instance.getKeys(index);
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder setKeys(
           int index, int value) {
-        ensureKeysIsMutable();
-        keys_.set(index, value);
-        
+        copyOnWrite();
+        instance.setKeys(index, value);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder addKeys(int value) {
-        ensureKeysIsMutable();
-        keys_.add(value);
-        
+        copyOnWrite();
+        instance.addKeys(value);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder addAllKeys(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureKeysIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, keys_);
-        
+        copyOnWrite();
+        instance.addAllKeys(values);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder clearKeys() {
-        keys_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        
+        copyOnWrite();
+        instance.clearKeys();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> vals_ = java.util.Collections.emptyList();
-      private void ensureValsIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = new java.util.ArrayList<java.lang.Integer>(vals_);
-          bitField0_ |= 0x00000004;
-         }
-      }
       /**
-       * <code>repeated uint32 vals = 3 [packed = true];</code>
-       *
        * <pre>
        * String IDs.
        * </pre>
+       *
+       * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getValsList() {
-        return java.util.Collections.unmodifiableList(vals_);
+        return java.util.Collections.unmodifiableList(
+            instance.getValsList());
       }
       /**
-       * <code>repeated uint32 vals = 3 [packed = true];</code>
-       *
        * <pre>
        * String IDs.
        * </pre>
+       *
+       * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public int getValsCount() {
-        return vals_.size();
+        return instance.getValsCount();
       }
       /**
-       * <code>repeated uint32 vals = 3 [packed = true];</code>
-       *
        * <pre>
        * String IDs.
        * </pre>
+       *
+       * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public int getVals(int index) {
-        return vals_.get(index);
+        return instance.getVals(index);
       }
       /**
-       * <code>repeated uint32 vals = 3 [packed = true];</code>
-       *
        * <pre>
        * String IDs.
        * </pre>
+       *
+       * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder setVals(
           int index, int value) {
-        ensureValsIsMutable();
-        vals_.set(index, value);
-        
+        copyOnWrite();
+        instance.setVals(index, value);
         return this;
       }
       /**
-       * <code>repeated uint32 vals = 3 [packed = true];</code>
-       *
        * <pre>
        * String IDs.
        * </pre>
+       *
+       * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder addVals(int value) {
-        ensureValsIsMutable();
-        vals_.add(value);
-        
+        copyOnWrite();
+        instance.addVals(value);
         return this;
       }
       /**
-       * <code>repeated uint32 vals = 3 [packed = true];</code>
-       *
        * <pre>
        * String IDs.
        * </pre>
+       *
+       * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder addAllVals(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureValsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, vals_);
-        
+        copyOnWrite();
+        instance.addAllVals(values);
         return this;
       }
       /**
-       * <code>repeated uint32 vals = 3 [packed = true];</code>
-       *
        * <pre>
        * String IDs.
        * </pre>
+       *
+       * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder clearVals() {
-        vals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        
+        copyOnWrite();
+        instance.clearVals();
         return this;
       }
 
-      private org.openstreetmap.osmosis.osmbinary.Osmformat.Info info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
       /**
-       * <code>optional .OSMPBF.Info info = 4;</code>
-       *
        * <pre>
        * May be omitted in omitmeta
        * </pre>
+       *
+       * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public boolean hasInfo() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasInfo();
       }
       /**
-       * <code>optional .OSMPBF.Info info = 4;</code>
-       *
        * <pre>
        * May be omitted in omitmeta
        * </pre>
+       *
+       * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo() {
-        return info_;
+        return instance.getInfo();
       }
       /**
-       * <code>optional .OSMPBF.Info info = 4;</code>
-       *
        * <pre>
        * May be omitted in omitmeta
        * </pre>
+       *
+       * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder setInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        info_ = value;
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.setInfo(value);
         return this;
-      }
+        }
       /**
-       * <code>optional .OSMPBF.Info info = 4;</code>
-       *
        * <pre>
        * May be omitted in omitmeta
        * </pre>
+       *
+       * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder setInfo(
           org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder builderForValue) {
-        info_ = builderForValue.build();
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.setInfo(builderForValue);
         return this;
       }
       /**
-       * <code>optional .OSMPBF.Info info = 4;</code>
-       *
        * <pre>
        * May be omitted in omitmeta
        * </pre>
+       *
+       * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder mergeInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
-        if (((bitField0_ & 0x00000008) == 0x00000008) &&
-            info_ != org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance()) {
-          info_ =
-            org.openstreetmap.osmosis.osmbinary.Osmformat.Info.newBuilder(info_).mergeFrom(value).buildPartial();
-        } else {
-          info_ = value;
-        }
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.mergeInfo(value);
         return this;
       }
       /**
-       * <code>optional .OSMPBF.Info info = 4;</code>
-       *
        * <pre>
        * May be omitted in omitmeta
        * </pre>
+       *
+       * <code>optional .OSMPBF.Info info = 4;</code>
        */
-      public Builder clearInfo() {
-        info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-
-        bitField0_ = (bitField0_ & ~0x00000008);
+      public Builder clearInfo() {  copyOnWrite();
+        instance.clearInfo();
         return this;
       }
 
-      private long lat_ ;
       /**
        * <code>required sint64 lat = 8;</code>
        */
       public boolean hasLat() {
-        return ((bitField0_ & 0x00000010) == 0x00000010);
+        return instance.hasLat();
       }
       /**
        * <code>required sint64 lat = 8;</code>
        */
       public long getLat() {
-        return lat_;
+        return instance.getLat();
       }
       /**
        * <code>required sint64 lat = 8;</code>
        */
       public Builder setLat(long value) {
-        bitField0_ |= 0x00000010;
-        lat_ = value;
-        
+        copyOnWrite();
+        instance.setLat(value);
         return this;
       }
       /**
        * <code>required sint64 lat = 8;</code>
        */
       public Builder clearLat() {
-        bitField0_ = (bitField0_ & ~0x00000010);
-        lat_ = 0L;
-        
+        copyOnWrite();
+        instance.clearLat();
         return this;
       }
 
-      private long lon_ ;
       /**
        * <code>required sint64 lon = 9;</code>
        */
       public boolean hasLon() {
-        return ((bitField0_ & 0x00000020) == 0x00000020);
+        return instance.hasLon();
       }
       /**
        * <code>required sint64 lon = 9;</code>
        */
       public long getLon() {
-        return lon_;
+        return instance.getLon();
       }
       /**
        * <code>required sint64 lon = 9;</code>
        */
       public Builder setLon(long value) {
-        bitField0_ |= 0x00000020;
-        lon_ = value;
-        
+        copyOnWrite();
+        instance.setLon(value);
         return this;
       }
       /**
        * <code>required sint64 lon = 9;</code>
        */
       public Builder clearLon() {
-        bitField0_ = (bitField0_ & ~0x00000020);
-        lon_ = 0L;
-        
+        copyOnWrite();
+        instance.clearLon();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.Node)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.Node();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (!hasId()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (!hasLat()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (!hasLon()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
+
+        }
+        case MAKE_IMMUTABLE: {
+          keys_.makeImmutable();
+          vals_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Node other = (org.openstreetmap.osmosis.osmbinary.Osmformat.Node) arg1;
+          id_ = visitor.visitLong(
+              hasId(), id_,
+              other.hasId(), other.id_);
+          keys_= visitor.visitIntList(keys_, other.keys_);
+          vals_= visitor.visitIntList(vals_, other.vals_);
+          info_ = visitor.visitMessage(info_, other.info_);
+          lat_ = visitor.visitLong(
+              hasLat(), lat_,
+              other.hasLat(), other.lat_);
+          lon_ = visitor.visitLong(
+              hasLon(), lon_,
+              other.hasLon(), other.lon_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  bitField0_ |= 0x00000001;
+                  id_ = input.readSInt64();
+                  break;
+                }
+                case 16: {
+                  if (!keys_.isModifiable()) {
+                    keys_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+                  }
+                  keys_.addInt(input.readUInt32());
+                  break;
+                }
+                case 18: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!keys_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    keys_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    keys_.addInt(input.readUInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 24: {
+                  if (!vals_.isModifiable()) {
+                    vals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+                  }
+                  vals_.addInt(input.readUInt32());
+                  break;
+                }
+                case 26: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!vals_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    vals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    vals_.addInt(input.readUInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 34: {
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder subBuilder = null;
+                  if (((bitField0_ & 0x00000002) == 0x00000002)) {
+                    subBuilder = info_.toBuilder();
+                  }
+                  info_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Info.parser(), extensionRegistry);
+                  if (subBuilder != null) {
+                    subBuilder.mergeFrom(info_);
+                    info_ = subBuilder.buildPartial();
+                  }
+                  bitField0_ |= 0x00000002;
+                  break;
+                }
+                case 64: {
+                  bitField0_ |= 0x00000004;
+                  lat_ = input.readSInt64();
+                  break;
+                }
+                case 72: {
+                  bitField0_ |= 0x00000008;
+                  lon_ = input.readSInt64();
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.Node.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
 
+
+    // @@protoc_insertion_point(class_scope:OSMPBF.Node)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.Node DEFAULT_INSTANCE;
     static {
-      defaultInstance = new Node(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new Node();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.Node)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.Node getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<Node> PARSER;
+
+    public static com.google.protobuf.Parser<Node> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface DenseNodesOrBuilder extends
@@ -9050,533 +9062,598 @@ public final class Osmformat {
       com.google.protobuf.MessageLiteOrBuilder {
 
     /**
-     * <code>repeated sint64 id = 1 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
      */
     java.util.List<java.lang.Long> getIdList();
     /**
-     * <code>repeated sint64 id = 1 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
      */
     int getIdCount();
     /**
-     * <code>repeated sint64 id = 1 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
      */
     long getId(int index);
 
     /**
-     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-     *
      * <pre>
      *repeated Info info = 4;
      * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
      */
     boolean hasDenseinfo();
     /**
-     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-     *
      * <pre>
      *repeated Info info = 4;
      * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
      */
     org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo getDenseinfo();
 
     /**
-     * <code>repeated sint64 lat = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
     java.util.List<java.lang.Long> getLatList();
     /**
-     * <code>repeated sint64 lat = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
     int getLatCount();
     /**
-     * <code>repeated sint64 lat = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
     long getLat(int index);
 
     /**
-     * <code>repeated sint64 lon = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
      */
     java.util.List<java.lang.Long> getLonList();
     /**
-     * <code>repeated sint64 lon = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
      */
     int getLonCount();
     /**
-     * <code>repeated sint64 lon = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
      */
     long getLon(int index);
 
     /**
-     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-     *
      * <pre>
      * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
      * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getKeysValsList();
     /**
-     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-     *
      * <pre>
      * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
      * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
      */
     int getKeysValsCount();
     /**
-     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-     *
      * <pre>
      * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
      * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
      */
     int getKeysVals(int index);
   }
   /**
    * Protobuf type {@code OSMPBF.DenseNodes}
    */
-  public static final class DenseNodes extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class DenseNodes extends
+      com.google.protobuf.GeneratedMessageLite<
+          DenseNodes, DenseNodes.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.DenseNodes)
       DenseNodesOrBuilder {
-    // Use DenseNodes.newBuilder() to construct.
-    private DenseNodes(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
+    private DenseNodes() {
+      id_ = emptyLongList();
+      lat_ = emptyLongList();
+      lon_ = emptyLongList();
+      keysVals_ = emptyIntList();
     }
-    private DenseNodes(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final DenseNodes defaultInstance;
-    public static DenseNodes getDefaultInstance() {
-      return defaultInstance;
+    private int bitField0_;
+    public static final int ID_FIELD_NUMBER = 1;
+    private com.google.protobuf.Internal.LongList id_;
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
+     */
+    public java.util.List<java.lang.Long>
+        getIdList() {
+      return id_;
     }
-
-    public DenseNodes getDefaultInstanceForType() {
-      return defaultInstance;
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
+     */
+    public int getIdCount() {
+      return id_.size();
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
+     */
+    public long getId(int index) {
+      return id_.getLong(index);
+    }
+    private int idMemoizedSerializedSize = -1;
+    private void ensureIdIsMutable() {
+      if (!id_.isModifiable()) {
+        id_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(id_);
+       }
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
+     */
+    private void setId(
+        int index, long value) {
+      ensureIdIsMutable();
+      id_.setLong(index, value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
+     */
+    private void addId(long value) {
+      ensureIdIsMutable();
+      id_.addLong(value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
+     */
+    private void addAllId(
+        java.lang.Iterable<? extends java.lang.Long> values) {
+      ensureIdIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, id_);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 id = 1 [packed = true];</code>
+     */
+    private void clearId() {
+      id_ = emptyLongList();
     }
 
-    private final com.google.protobuf.ByteString unknownFields;
-    private DenseNodes(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-                id_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000001;
-              }
-              id_.add(input.readSInt64());
-              break;
-            }
-            case 10: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) {
-                id_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000001;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                id_.add(input.readSInt64());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 42: {
-              org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000001) == 0x00000001)) {
-                subBuilder = denseinfo_.toBuilder();
-              }
-              denseinfo_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.PARSER, extensionRegistry);
-              if (subBuilder != null) {
-                subBuilder.mergeFrom(denseinfo_);
-                denseinfo_ = subBuilder.buildPartial();
-              }
-              bitField0_ |= 0x00000001;
-              break;
-            }
-            case 64: {
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                lat_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              lat_.add(input.readSInt64());
-              break;
-            }
-            case 66: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
-                lat_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                lat_.add(input.readSInt64());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 72: {
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-                lon_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              lon_.add(input.readSInt64());
-              break;
-            }
-            case 74: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) {
-                lon_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                lon_.add(input.readSInt64());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 80: {
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-                keysVals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              keysVals_.add(input.readInt32());
-              break;
-            }
-            case 82: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) {
-                keysVals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                keysVals_.add(input.readInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-          id_ = java.util.Collections.unmodifiableList(id_);
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          lat_ = java.util.Collections.unmodifiableList(lat_);
-        }
-        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-          lon_ = java.util.Collections.unmodifiableList(lon_);
-        }
-        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-          keysVals_ = java.util.Collections.unmodifiableList(keysVals_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
+    public static final int DENSEINFO_FIELD_NUMBER = 5;
+    private org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo denseinfo_;
+    /**
+     * <pre>
+     *repeated Info info = 4;
+     * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
+     */
+    public boolean hasDenseinfo() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
+    }
+    /**
+     * <pre>
+     *repeated Info info = 4;
+     * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
+     */
+    public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo getDenseinfo() {
+      return denseinfo_ == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance() : denseinfo_;
+    }
+    /**
+     * <pre>
+     *repeated Info info = 4;
+     * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
+     */
+    private void setDenseinfo(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
+      denseinfo_ = value;
+      bitField0_ |= 0x00000001;
+      }
+    /**
+     * <pre>
+     *repeated Info info = 4;
+     * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
+     */
+    private void setDenseinfo(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.Builder builderForValue) {
+      denseinfo_ = builderForValue.build();
+      bitField0_ |= 0x00000001;
     }
-    public static com.google.protobuf.Parser<DenseNodes> PARSER =
-        new com.google.protobuf.AbstractParser<DenseNodes>() {
-      public DenseNodes parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new DenseNodes(input, extensionRegistry);
+    /**
+     * <pre>
+     *repeated Info info = 4;
+     * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
+     */
+    private void mergeDenseinfo(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo value) {
+      if (denseinfo_ != null &&
+          denseinfo_ != org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance()) {
+        denseinfo_ =
+          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.newBuilder(denseinfo_).mergeFrom(value).buildPartial();
+      } else {
+        denseinfo_ = value;
       }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<DenseNodes> getParserForType() {
-      return PARSER;
+      bitField0_ |= 0x00000001;
     }
-
-    private int bitField0_;
-    public static final int ID_FIELD_NUMBER = 1;
-    private java.util.List<java.lang.Long> id_;
     /**
-     * <code>repeated sint64 id = 1 [packed = true];</code>
-     *
      * <pre>
-     * DELTA coded
+     *repeated Info info = 4;
      * </pre>
+     *
+     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
      */
-    public java.util.List<java.lang.Long>
-        getIdList() {
-      return id_;
+    private void clearDenseinfo() {  denseinfo_ = null;
+      bitField0_ = (bitField0_ & ~0x00000001);
     }
+
+    public static final int LAT_FIELD_NUMBER = 8;
+    private com.google.protobuf.Internal.LongList lat_;
     /**
-     * <code>repeated sint64 id = 1 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
-    public int getIdCount() {
-      return id_.size();
+    public java.util.List<java.lang.Long>
+        getLatList() {
+      return lat_;
     }
     /**
-     * <code>repeated sint64 id = 1 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
-    public long getId(int index) {
-      return id_.get(index);
+    public int getLatCount() {
+      return lat_.size();
     }
-    private int idMemoizedSerializedSize = -1;
-
-    public static final int DENSEINFO_FIELD_NUMBER = 5;
-    private org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo denseinfo_;
     /**
-     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-     *
      * <pre>
-     *repeated Info info = 4;
+     * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
-    public boolean hasDenseinfo() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
+    public long getLat(int index) {
+      return lat_.getLong(index);
+    }
+    private int latMemoizedSerializedSize = -1;
+    private void ensureLatIsMutable() {
+      if (!lat_.isModifiable()) {
+        lat_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(lat_);
+       }
     }
     /**
-     * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-     *
      * <pre>
-     *repeated Info info = 4;
+     * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
-    public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo getDenseinfo() {
-      return denseinfo_;
+    private void setLat(
+        int index, long value) {
+      ensureLatIsMutable();
+      lat_.setLong(index, value);
     }
-
-    public static final int LAT_FIELD_NUMBER = 8;
-    private java.util.List<java.lang.Long> lat_;
     /**
-     * <code>repeated sint64 lat = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
-    public java.util.List<java.lang.Long>
-        getLatList() {
-      return lat_;
+    private void addLat(long value) {
+      ensureLatIsMutable();
+      lat_.addLong(value);
     }
     /**
-     * <code>repeated sint64 lat = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
-    public int getLatCount() {
-      return lat_.size();
+    private void addAllLat(
+        java.lang.Iterable<? extends java.lang.Long> values) {
+      ensureLatIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, lat_);
     }
     /**
-     * <code>repeated sint64 lat = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lat = 8 [packed = true];</code>
      */
-    public long getLat(int index) {
-      return lat_.get(index);
+    private void clearLat() {
+      lat_ = emptyLongList();
     }
-    private int latMemoizedSerializedSize = -1;
 
     public static final int LON_FIELD_NUMBER = 9;
-    private java.util.List<java.lang.Long> lon_;
+    private com.google.protobuf.Internal.LongList lon_;
     /**
-     * <code>repeated sint64 lon = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
      */
     public java.util.List<java.lang.Long>
         getLonList() {
       return lon_;
     }
     /**
-     * <code>repeated sint64 lon = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
      */
     public int getLonCount() {
       return lon_.size();
     }
     /**
-     * <code>repeated sint64 lon = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
      */
     public long getLon(int index) {
-      return lon_.get(index);
+      return lon_.getLong(index);
     }
     private int lonMemoizedSerializedSize = -1;
+    private void ensureLonIsMutable() {
+      if (!lon_.isModifiable()) {
+        lon_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(lon_);
+       }
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
+     */
+    private void setLon(
+        int index, long value) {
+      ensureLonIsMutable();
+      lon_.setLong(index, value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
+     */
+    private void addLon(long value) {
+      ensureLonIsMutable();
+      lon_.addLong(value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
+     */
+    private void addAllLon(
+        java.lang.Iterable<? extends java.lang.Long> values) {
+      ensureLonIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, lon_);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 lon = 9 [packed = true];</code>
+     */
+    private void clearLon() {
+      lon_ = emptyLongList();
+    }
 
     public static final int KEYS_VALS_FIELD_NUMBER = 10;
-    private java.util.List<java.lang.Integer> keysVals_;
+    private com.google.protobuf.Internal.IntList keysVals_;
     /**
-     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-     *
      * <pre>
      * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
      * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
      */
     public java.util.List<java.lang.Integer>
         getKeysValsList() {
       return keysVals_;
     }
     /**
-     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-     *
      * <pre>
      * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
      * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
      */
     public int getKeysValsCount() {
       return keysVals_.size();
     }
     /**
-     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-     *
      * <pre>
      * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
      * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
      */
     public int getKeysVals(int index) {
-      return keysVals_.get(index);
+      return keysVals_.getInt(index);
     }
     private int keysValsMemoizedSerializedSize = -1;
-
-    private void initFields() {
-      id_ = java.util.Collections.emptyList();
-      denseinfo_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance();
-      lat_ = java.util.Collections.emptyList();
-      lon_ = java.util.Collections.emptyList();
-      keysVals_ = java.util.Collections.emptyList();
+    private void ensureKeysValsIsMutable() {
+      if (!keysVals_.isModifiable()) {
+        keysVals_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(keysVals_);
+       }
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <pre>
+     * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
+     * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
+     */
+    private void setKeysVals(
+        int index, int value) {
+      ensureKeysValsIsMutable();
+      keysVals_.setInt(index, value);
+    }
+    /**
+     * <pre>
+     * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
+     * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
+     */
+    private void addKeysVals(int value) {
+      ensureKeysValsIsMutable();
+      keysVals_.addInt(value);
+    }
+    /**
+     * <pre>
+     * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
+     * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
+     */
+    private void addAllKeysVals(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureKeysValsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, keysVals_);
+    }
+    /**
+     * <pre>
+     * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
+     * </pre>
+     *
+     * <code>repeated int32 keys_vals = 10 [packed = true];</code>
+     */
+    private void clearKeysVals() {
+      keysVals_ = emptyIntList();
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
       if (getIdList().size() > 0) {
-        output.writeRawVarint32(10);
-        output.writeRawVarint32(idMemoizedSerializedSize);
+        output.writeUInt32NoTag(10);
+        output.writeUInt32NoTag(idMemoizedSerializedSize);
       }
       for (int i = 0; i < id_.size(); i++) {
-        output.writeSInt64NoTag(id_.get(i));
+        output.writeSInt64NoTag(id_.getLong(i));
       }
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeMessage(5, denseinfo_);
+        output.writeMessage(5, getDenseinfo());
       }
       if (getLatList().size() > 0) {
-        output.writeRawVarint32(66);
-        output.writeRawVarint32(latMemoizedSerializedSize);
+        output.writeUInt32NoTag(66);
+        output.writeUInt32NoTag(latMemoizedSerializedSize);
       }
       for (int i = 0; i < lat_.size(); i++) {
-        output.writeSInt64NoTag(lat_.get(i));
+        output.writeSInt64NoTag(lat_.getLong(i));
       }
       if (getLonList().size() > 0) {
-        output.writeRawVarint32(74);
-        output.writeRawVarint32(lonMemoizedSerializedSize);
+        output.writeUInt32NoTag(74);
+        output.writeUInt32NoTag(lonMemoizedSerializedSize);
       }
       for (int i = 0; i < lon_.size(); i++) {
-        output.writeSInt64NoTag(lon_.get(i));
+        output.writeSInt64NoTag(lon_.getLong(i));
       }
       if (getKeysValsList().size() > 0) {
-        output.writeRawVarint32(82);
-        output.writeRawVarint32(keysValsMemoizedSerializedSize);
+        output.writeUInt32NoTag(82);
+        output.writeUInt32NoTag(keysValsMemoizedSerializedSize);
       }
       for (int i = 0; i < keysVals_.size(); i++) {
-        output.writeInt32NoTag(keysVals_.get(i));
+        output.writeInt32NoTag(keysVals_.getInt(i));
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -9586,7 +9663,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < id_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt64SizeNoTag(id_.get(i));
+            .computeSInt64SizeNoTag(id_.getLong(i));
         }
         size += dataSize;
         if (!getIdList().isEmpty()) {
@@ -9598,13 +9675,13 @@ public final class Osmformat {
       }
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(5, denseinfo_);
+          .computeMessageSize(5, getDenseinfo());
       }
       {
         int dataSize = 0;
         for (int i = 0; i < lat_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt64SizeNoTag(lat_.get(i));
+            .computeSInt64SizeNoTag(lat_.getLong(i));
         }
         size += dataSize;
         if (!getLatList().isEmpty()) {
@@ -9618,7 +9695,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < lon_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt64SizeNoTag(lon_.get(i));
+            .computeSInt64SizeNoTag(lon_.getLong(i));
         }
         size += dataSize;
         if (!getLonList().isEmpty()) {
@@ -9632,7 +9709,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < keysVals_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeInt32SizeNoTag(keysVals_.get(i));
+            .computeInt32SizeNoTag(keysVals_.getInt(i));
         }
         size += dataSize;
         if (!getKeysValsList().isEmpty()) {
@@ -9642,703 +9719,690 @@ public final class Osmformat {
         }
         keysValsMemoizedSerializedSize = dataSize;
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.DenseNodes}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.DenseNodes)
         org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodesOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        id_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        denseinfo_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        lat_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        lon_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        keysVals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes result = new org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((bitField0_ & 0x00000001) == 0x00000001)) {
-          id_ = java.util.Collections.unmodifiableList(id_);
-          bitField0_ = (bitField0_ & ~0x00000001);
-        }
-        result.id_ = id_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.denseinfo_ = denseinfo_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          lat_ = java.util.Collections.unmodifiableList(lat_);
-          bitField0_ = (bitField0_ & ~0x00000004);
-        }
-        result.lat_ = lat_;
-        if (((bitField0_ & 0x00000008) == 0x00000008)) {
-          lon_ = java.util.Collections.unmodifiableList(lon_);
-          bitField0_ = (bitField0_ & ~0x00000008);
-        }
-        result.lon_ = lon_;
-        if (((bitField0_ & 0x00000010) == 0x00000010)) {
-          keysVals_ = java.util.Collections.unmodifiableList(keysVals_);
-          bitField0_ = (bitField0_ & ~0x00000010);
-        }
-        result.keysVals_ = keysVals_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.getDefaultInstance()) return this;
-        if (!other.id_.isEmpty()) {
-          if (id_.isEmpty()) {
-            id_ = other.id_;
-            bitField0_ = (bitField0_ & ~0x00000001);
-          } else {
-            ensureIdIsMutable();
-            id_.addAll(other.id_);
-          }
-          
-        }
-        if (other.hasDenseinfo()) {
-          mergeDenseinfo(other.getDenseinfo());
-        }
-        if (!other.lat_.isEmpty()) {
-          if (lat_.isEmpty()) {
-            lat_ = other.lat_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureLatIsMutable();
-            lat_.addAll(other.lat_);
-          }
-          
-        }
-        if (!other.lon_.isEmpty()) {
-          if (lon_.isEmpty()) {
-            lon_ = other.lon_;
-            bitField0_ = (bitField0_ & ~0x00000008);
-          } else {
-            ensureLonIsMutable();
-            lon_.addAll(other.lon_);
-          }
-          
-        }
-        if (!other.keysVals_.isEmpty()) {
-          if (keysVals_.isEmpty()) {
-            keysVals_ = other.keysVals_;
-            bitField0_ = (bitField0_ & ~0x00000010);
-          } else {
-            ensureKeysValsIsMutable();
-            keysVals_.addAll(other.keysVals_);
-          }
-          
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        return true;
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private java.util.List<java.lang.Long> id_ = java.util.Collections.emptyList();
-      private void ensureIdIsMutable() {
-        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
-          id_ = new java.util.ArrayList<java.lang.Long>(id_);
-          bitField0_ |= 0x00000001;
-         }
-      }
       /**
-       * <code>repeated sint64 id = 1 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 id = 1 [packed = true];</code>
        */
       public java.util.List<java.lang.Long>
           getIdList() {
-        return java.util.Collections.unmodifiableList(id_);
+        return java.util.Collections.unmodifiableList(
+            instance.getIdList());
       }
       /**
-       * <code>repeated sint64 id = 1 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 id = 1 [packed = true];</code>
        */
       public int getIdCount() {
-        return id_.size();
+        return instance.getIdCount();
       }
       /**
-       * <code>repeated sint64 id = 1 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 id = 1 [packed = true];</code>
        */
       public long getId(int index) {
-        return id_.get(index);
+        return instance.getId(index);
       }
       /**
-       * <code>repeated sint64 id = 1 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 id = 1 [packed = true];</code>
        */
       public Builder setId(
           int index, long value) {
-        ensureIdIsMutable();
-        id_.set(index, value);
-        
+        copyOnWrite();
+        instance.setId(index, value);
         return this;
       }
       /**
-       * <code>repeated sint64 id = 1 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 id = 1 [packed = true];</code>
        */
       public Builder addId(long value) {
-        ensureIdIsMutable();
-        id_.add(value);
-        
+        copyOnWrite();
+        instance.addId(value);
         return this;
       }
       /**
-       * <code>repeated sint64 id = 1 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 id = 1 [packed = true];</code>
        */
       public Builder addAllId(
           java.lang.Iterable<? extends java.lang.Long> values) {
-        ensureIdIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, id_);
-        
+        copyOnWrite();
+        instance.addAllId(values);
         return this;
       }
       /**
-       * <code>repeated sint64 id = 1 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 id = 1 [packed = true];</code>
        */
       public Builder clearId() {
-        id_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000001);
-        
+        copyOnWrite();
+        instance.clearId();
         return this;
       }
 
-      private org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo denseinfo_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance();
       /**
-       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-       *
        * <pre>
        *repeated Info info = 4;
        * </pre>
+       *
+       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
        */
       public boolean hasDenseinfo() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
+        return instance.hasDenseinfo();
       }
       /**
-       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-       *
        * <pre>
        *repeated Info info = 4;
        * </pre>
+       *
+       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo getDenseinfo() {
-        return denseinfo_;
+        return instance.getDenseinfo();
       }
       /**
-       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-       *
        * <pre>
        *repeated Info info = 4;
        * </pre>
+       *
+       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
        */
       public Builder setDenseinfo(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        denseinfo_ = value;
-
-        bitField0_ |= 0x00000002;
+        copyOnWrite();
+        instance.setDenseinfo(value);
         return this;
-      }
+        }
       /**
-       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-       *
        * <pre>
        *repeated Info info = 4;
        * </pre>
+       *
+       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
        */
       public Builder setDenseinfo(
           org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.Builder builderForValue) {
-        denseinfo_ = builderForValue.build();
-
-        bitField0_ |= 0x00000002;
+        copyOnWrite();
+        instance.setDenseinfo(builderForValue);
         return this;
       }
       /**
-       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-       *
        * <pre>
        *repeated Info info = 4;
        * </pre>
+       *
+       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
        */
       public Builder mergeDenseinfo(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo value) {
-        if (((bitField0_ & 0x00000002) == 0x00000002) &&
-            denseinfo_ != org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance()) {
-          denseinfo_ =
-            org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.newBuilder(denseinfo_).mergeFrom(value).buildPartial();
-        } else {
-          denseinfo_ = value;
-        }
-
-        bitField0_ |= 0x00000002;
+        copyOnWrite();
+        instance.mergeDenseinfo(value);
         return this;
       }
       /**
-       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
-       *
        * <pre>
        *repeated Info info = 4;
        * </pre>
+       *
+       * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code>
        */
-      public Builder clearDenseinfo() {
-        denseinfo_ = org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.getDefaultInstance();
-
-        bitField0_ = (bitField0_ & ~0x00000002);
+      public Builder clearDenseinfo() {  copyOnWrite();
+        instance.clearDenseinfo();
         return this;
       }
 
-      private java.util.List<java.lang.Long> lat_ = java.util.Collections.emptyList();
-      private void ensureLatIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          lat_ = new java.util.ArrayList<java.lang.Long>(lat_);
-          bitField0_ |= 0x00000004;
-         }
-      }
       /**
-       * <code>repeated sint64 lat = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lat = 8 [packed = true];</code>
        */
       public java.util.List<java.lang.Long>
           getLatList() {
-        return java.util.Collections.unmodifiableList(lat_);
+        return java.util.Collections.unmodifiableList(
+            instance.getLatList());
       }
       /**
-       * <code>repeated sint64 lat = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lat = 8 [packed = true];</code>
        */
       public int getLatCount() {
-        return lat_.size();
+        return instance.getLatCount();
       }
       /**
-       * <code>repeated sint64 lat = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lat = 8 [packed = true];</code>
        */
       public long getLat(int index) {
-        return lat_.get(index);
+        return instance.getLat(index);
       }
       /**
-       * <code>repeated sint64 lat = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lat = 8 [packed = true];</code>
        */
       public Builder setLat(
           int index, long value) {
-        ensureLatIsMutable();
-        lat_.set(index, value);
-        
+        copyOnWrite();
+        instance.setLat(index, value);
         return this;
       }
       /**
-       * <code>repeated sint64 lat = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lat = 8 [packed = true];</code>
        */
       public Builder addLat(long value) {
-        ensureLatIsMutable();
-        lat_.add(value);
-        
+        copyOnWrite();
+        instance.addLat(value);
         return this;
       }
       /**
-       * <code>repeated sint64 lat = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lat = 8 [packed = true];</code>
        */
       public Builder addAllLat(
           java.lang.Iterable<? extends java.lang.Long> values) {
-        ensureLatIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, lat_);
-        
+        copyOnWrite();
+        instance.addAllLat(values);
         return this;
       }
       /**
-       * <code>repeated sint64 lat = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lat = 8 [packed = true];</code>
        */
       public Builder clearLat() {
-        lat_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        
+        copyOnWrite();
+        instance.clearLat();
         return this;
       }
 
-      private java.util.List<java.lang.Long> lon_ = java.util.Collections.emptyList();
-      private void ensureLonIsMutable() {
-        if (!((bitField0_ & 0x00000008) == 0x00000008)) {
-          lon_ = new java.util.ArrayList<java.lang.Long>(lon_);
-          bitField0_ |= 0x00000008;
-         }
-      }
       /**
-       * <code>repeated sint64 lon = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lon = 9 [packed = true];</code>
        */
       public java.util.List<java.lang.Long>
           getLonList() {
-        return java.util.Collections.unmodifiableList(lon_);
+        return java.util.Collections.unmodifiableList(
+            instance.getLonList());
       }
       /**
-       * <code>repeated sint64 lon = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lon = 9 [packed = true];</code>
        */
       public int getLonCount() {
-        return lon_.size();
+        return instance.getLonCount();
       }
       /**
-       * <code>repeated sint64 lon = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lon = 9 [packed = true];</code>
        */
       public long getLon(int index) {
-        return lon_.get(index);
+        return instance.getLon(index);
       }
       /**
-       * <code>repeated sint64 lon = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lon = 9 [packed = true];</code>
        */
       public Builder setLon(
           int index, long value) {
-        ensureLonIsMutable();
-        lon_.set(index, value);
-        
+        copyOnWrite();
+        instance.setLon(index, value);
         return this;
       }
       /**
-       * <code>repeated sint64 lon = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lon = 9 [packed = true];</code>
        */
       public Builder addLon(long value) {
-        ensureLonIsMutable();
-        lon_.add(value);
-        
+        copyOnWrite();
+        instance.addLon(value);
         return this;
       }
       /**
-       * <code>repeated sint64 lon = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lon = 9 [packed = true];</code>
        */
       public Builder addAllLon(
           java.lang.Iterable<? extends java.lang.Long> values) {
-        ensureLonIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, lon_);
-        
+        copyOnWrite();
+        instance.addAllLon(values);
         return this;
       }
       /**
-       * <code>repeated sint64 lon = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 lon = 9 [packed = true];</code>
        */
       public Builder clearLon() {
-        lon_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        
+        copyOnWrite();
+        instance.clearLon();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> keysVals_ = java.util.Collections.emptyList();
-      private void ensureKeysValsIsMutable() {
-        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
-          keysVals_ = new java.util.ArrayList<java.lang.Integer>(keysVals_);
-          bitField0_ |= 0x00000010;
-         }
-      }
       /**
-       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-       *
        * <pre>
        * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
        * </pre>
+       *
+       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getKeysValsList() {
-        return java.util.Collections.unmodifiableList(keysVals_);
+        return java.util.Collections.unmodifiableList(
+            instance.getKeysValsList());
       }
       /**
-       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-       *
        * <pre>
        * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
        * </pre>
+       *
+       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
        */
       public int getKeysValsCount() {
-        return keysVals_.size();
+        return instance.getKeysValsCount();
       }
       /**
-       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-       *
        * <pre>
        * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
        * </pre>
+       *
+       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
        */
       public int getKeysVals(int index) {
-        return keysVals_.get(index);
+        return instance.getKeysVals(index);
       }
       /**
-       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-       *
        * <pre>
        * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
        * </pre>
+       *
+       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
        */
       public Builder setKeysVals(
           int index, int value) {
-        ensureKeysValsIsMutable();
-        keysVals_.set(index, value);
-        
+        copyOnWrite();
+        instance.setKeysVals(index, value);
         return this;
       }
       /**
-       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-       *
        * <pre>
        * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
        * </pre>
+       *
+       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
        */
       public Builder addKeysVals(int value) {
-        ensureKeysValsIsMutable();
-        keysVals_.add(value);
-        
+        copyOnWrite();
+        instance.addKeysVals(value);
         return this;
       }
       /**
-       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-       *
        * <pre>
        * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
        * </pre>
+       *
+       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
        */
       public Builder addAllKeysVals(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureKeysValsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, keysVals_);
-        
+        copyOnWrite();
+        instance.addAllKeysVals(values);
         return this;
       }
       /**
-       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
-       *
        * <pre>
        * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
        * </pre>
+       *
+       * <code>repeated int32 keys_vals = 10 [packed = true];</code>
        */
       public Builder clearKeysVals() {
-        keysVals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        
+        copyOnWrite();
+        instance.clearKeysVals();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.DenseNodes)
     }
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes();
+        }
+        case IS_INITIALIZED: {
+          return DEFAULT_INSTANCE;
+        }
+        case MAKE_IMMUTABLE: {
+          id_.makeImmutable();
+          lat_.makeImmutable();
+          lon_.makeImmutable();
+          keysVals_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes other = (org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes) arg1;
+          id_= visitor.visitLongList(id_, other.id_);
+          denseinfo_ = visitor.visitMessage(denseinfo_, other.denseinfo_);
+          lat_= visitor.visitLongList(lat_, other.lat_);
+          lon_= visitor.visitLongList(lon_, other.lon_);
+          keysVals_= visitor.visitIntList(keysVals_, other.keysVals_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  if (!id_.isModifiable()) {
+                    id_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(id_);
+                  }
+                  id_.addLong(input.readSInt64());
+                  break;
+                }
+                case 10: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!id_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    id_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(id_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    id_.addLong(input.readSInt64());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 42: {
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.Builder subBuilder = null;
+                  if (((bitField0_ & 0x00000001) == 0x00000001)) {
+                    subBuilder = denseinfo_.toBuilder();
+                  }
+                  denseinfo_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo.parser(), extensionRegistry);
+                  if (subBuilder != null) {
+                    subBuilder.mergeFrom(denseinfo_);
+                    denseinfo_ = subBuilder.buildPartial();
+                  }
+                  bitField0_ |= 0x00000001;
+                  break;
+                }
+                case 64: {
+                  if (!lat_.isModifiable()) {
+                    lat_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(lat_);
+                  }
+                  lat_.addLong(input.readSInt64());
+                  break;
+                }
+                case 66: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!lat_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    lat_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(lat_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    lat_.addLong(input.readSInt64());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 72: {
+                  if (!lon_.isModifiable()) {
+                    lon_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(lon_);
+                  }
+                  lon_.addLong(input.readSInt64());
+                  break;
+                }
+                case 74: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!lon_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    lon_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(lon_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    lon_.addLong(input.readSInt64());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 80: {
+                  if (!keysVals_.isModifiable()) {
+                    keysVals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keysVals_);
+                  }
+                  keysVals_.addInt(input.readInt32());
+                  break;
+                }
+                case 82: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!keysVals_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    keysVals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keysVals_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    keysVals_.addInt(input.readInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
+
 
+    // @@protoc_insertion_point(class_scope:OSMPBF.DenseNodes)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes DEFAULT_INSTANCE;
     static {
-      defaultInstance = new DenseNodes(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new DenseNodes();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.DenseNodes)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.DenseNodes getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<DenseNodes> PARSER;
+
+    public static com.google.protobuf.Parser<DenseNodes> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface WayOrBuilder extends
@@ -10355,27 +10419,27 @@ public final class Osmformat {
     long getId();
 
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getKeysList();
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     int getKeysCount();
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     int getKeys(int index);
 
@@ -10402,203 +10466,43 @@ public final class Osmformat {
     org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo();
 
     /**
-     * <code>repeated sint64 refs = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
      */
     java.util.List<java.lang.Long> getRefsList();
     /**
-     * <code>repeated sint64 refs = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
      */
     int getRefsCount();
     /**
-     * <code>repeated sint64 refs = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
      */
     long getRefs(int index);
   }
   /**
    * Protobuf type {@code OSMPBF.Way}
    */
-  public static final class Way extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class Way extends
+      com.google.protobuf.GeneratedMessageLite<
+          Way, Way.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.Way)
       WayOrBuilder {
-    // Use Way.newBuilder() to construct.
-    private Way(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private Way(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final Way defaultInstance;
-    public static Way getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public Way getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private Way(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              bitField0_ |= 0x00000001;
-              id_ = input.readInt64();
-              break;
-            }
-            case 16: {
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                keys_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              keys_.add(input.readUInt32());
-              break;
-            }
-            case 18: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
-                keys_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                keys_.add(input.readUInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 24: {
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                vals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              vals_.add(input.readUInt32());
-              break;
-            }
-            case 26: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
-                vals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                vals_.add(input.readUInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 34: {
-              org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000002) == 0x00000002)) {
-                subBuilder = info_.toBuilder();
-              }
-              info_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Info.PARSER, extensionRegistry);
-              if (subBuilder != null) {
-                subBuilder.mergeFrom(info_);
-                info_ = subBuilder.buildPartial();
-              }
-              bitField0_ |= 0x00000002;
-              break;
-            }
-            case 64: {
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-                refs_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              refs_.add(input.readSInt64());
-              break;
-            }
-            case 66: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) {
-                refs_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                refs_.add(input.readSInt64());
-              }
-              input.popLimit(limit);
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = java.util.Collections.unmodifiableList(keys_);
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = java.util.Collections.unmodifiableList(vals_);
-        }
-        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-          refs_ = java.util.Collections.unmodifiableList(refs_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<Way> PARSER =
-        new com.google.protobuf.AbstractParser<Way>() {
-      public Way parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new Way(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<Way> getParserForType() {
-      return PARSER;
+    private Way() {
+      keys_ = emptyIntList();
+      vals_ = emptyIntList();
+      refs_ = emptyLongList();
     }
-
     private int bitField0_;
     public static final int ID_FIELD_NUMBER = 1;
     private long id_;
@@ -10614,44 +10518,110 @@ public final class Osmformat {
     public long getId() {
       return id_;
     }
+    /**
+     * <code>required int64 id = 1;</code>
+     */
+    private void setId(long value) {
+      bitField0_ |= 0x00000001;
+      id_ = value;
+    }
+    /**
+     * <code>required int64 id = 1;</code>
+     */
+    private void clearId() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      id_ = 0L;
+    }
 
     public static final int KEYS_FIELD_NUMBER = 2;
-    private java.util.List<java.lang.Integer> keys_;
+    private com.google.protobuf.Internal.IntList keys_;
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     public java.util.List<java.lang.Integer>
         getKeysList() {
       return keys_;
     }
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     public int getKeysCount() {
       return keys_.size();
     }
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    public int getKeys(int index) {
+      return keys_.getInt(index);
+    }
+    private int keysMemoizedSerializedSize = -1;
+    private void ensureKeysIsMutable() {
+      if (!keys_.isModifiable()) {
+        keys_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+       }
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void setKeys(
+        int index, int value) {
+      ensureKeysIsMutable();
+      keys_.setInt(index, value);
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void addKeys(int value) {
+      ensureKeysIsMutable();
+      keys_.addInt(value);
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void addAllKeys(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureKeysIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, keys_);
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
-    public int getKeys(int index) {
-      return keys_.get(index);
+    private void clearKeys() {
+      keys_ = emptyIntList();
     }
-    private int keysMemoizedSerializedSize = -1;
 
     public static final int VALS_FIELD_NUMBER = 3;
-    private java.util.List<java.lang.Integer> vals_;
+    private com.google.protobuf.Internal.IntList vals_;
     /**
      * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
@@ -10669,9 +10639,45 @@ public final class Osmformat {
      * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     public int getVals(int index) {
-      return vals_.get(index);
+      return vals_.getInt(index);
     }
     private int valsMemoizedSerializedSize = -1;
+    private void ensureValsIsMutable() {
+      if (!vals_.isModifiable()) {
+        vals_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+       }
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void setVals(
+        int index, int value) {
+      ensureValsIsMutable();
+      vals_.setInt(index, value);
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void addVals(int value) {
+      ensureValsIsMutable();
+      vals_.addInt(value);
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void addAllVals(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureValsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, vals_);
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void clearVals() {
+      vals_ = emptyIntList();
+    }
 
     public static final int INFO_FIELD_NUMBER = 4;
     private org.openstreetmap.osmosis.osmbinary.Osmformat.Info info_;
@@ -10685,63 +10691,131 @@ public final class Osmformat {
      * <code>optional .OSMPBF.Info info = 4;</code>
      */
     public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo() {
-      return info_;
+      return info_ == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance() : info_;
+    }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void setInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      info_ = value;
+      bitField0_ |= 0x00000002;
+      }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void setInfo(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder builderForValue) {
+      info_ = builderForValue.build();
+      bitField0_ |= 0x00000002;
+    }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void mergeInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
+      if (info_ != null &&
+          info_ != org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance()) {
+        info_ =
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Info.newBuilder(info_).mergeFrom(value).buildPartial();
+      } else {
+        info_ = value;
+      }
+      bitField0_ |= 0x00000002;
+    }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void clearInfo() {  info_ = null;
+      bitField0_ = (bitField0_ & ~0x00000002);
     }
 
     public static final int REFS_FIELD_NUMBER = 8;
-    private java.util.List<java.lang.Long> refs_;
+    private com.google.protobuf.Internal.LongList refs_;
     /**
-     * <code>repeated sint64 refs = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
      */
     public java.util.List<java.lang.Long>
         getRefsList() {
       return refs_;
     }
     /**
-     * <code>repeated sint64 refs = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
      */
     public int getRefsCount() {
       return refs_.size();
     }
     /**
-     * <code>repeated sint64 refs = 8 [packed = true];</code>
-     *
      * <pre>
      * DELTA coded
      * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
      */
     public long getRefs(int index) {
-      return refs_.get(index);
+      return refs_.getLong(index);
     }
     private int refsMemoizedSerializedSize = -1;
-
-    private void initFields() {
-      id_ = 0L;
-      keys_ = java.util.Collections.emptyList();
-      vals_ = java.util.Collections.emptyList();
-      info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-      refs_ = java.util.Collections.emptyList();
+    private void ensureRefsIsMutable() {
+      if (!refs_.isModifiable()) {
+        refs_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(refs_);
+       }
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      if (!hasId()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      memoizedIsInitialized = 1;
-      return true;
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
+     */
+    private void setRefs(
+        int index, long value) {
+      ensureRefsIsMutable();
+      refs_.setLong(index, value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
+     */
+    private void addRefs(long value) {
+      ensureRefsIsMutable();
+      refs_.addLong(value);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
+     */
+    private void addAllRefs(
+        java.lang.Iterable<? extends java.lang.Long> values) {
+      ensureRefsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, refs_);
+    }
+    /**
+     * <pre>
+     * DELTA coded
+     * </pre>
+     *
+     * <code>repeated sint64 refs = 8 [packed = true];</code>
+     */
+    private void clearRefs() {
+      refs_ = emptyLongList();
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
@@ -10751,33 +10825,32 @@ public final class Osmformat {
         output.writeInt64(1, id_);
       }
       if (getKeysList().size() > 0) {
-        output.writeRawVarint32(18);
-        output.writeRawVarint32(keysMemoizedSerializedSize);
+        output.writeUInt32NoTag(18);
+        output.writeUInt32NoTag(keysMemoizedSerializedSize);
       }
       for (int i = 0; i < keys_.size(); i++) {
-        output.writeUInt32NoTag(keys_.get(i));
+        output.writeUInt32NoTag(keys_.getInt(i));
       }
       if (getValsList().size() > 0) {
-        output.writeRawVarint32(26);
-        output.writeRawVarint32(valsMemoizedSerializedSize);
+        output.writeUInt32NoTag(26);
+        output.writeUInt32NoTag(valsMemoizedSerializedSize);
       }
       for (int i = 0; i < vals_.size(); i++) {
-        output.writeUInt32NoTag(vals_.get(i));
+        output.writeUInt32NoTag(vals_.getInt(i));
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
-        output.writeMessage(4, info_);
+        output.writeMessage(4, getInfo());
       }
       if (getRefsList().size() > 0) {
-        output.writeRawVarint32(66);
-        output.writeRawVarint32(refsMemoizedSerializedSize);
+        output.writeUInt32NoTag(66);
+        output.writeUInt32NoTag(refsMemoizedSerializedSize);
       }
       for (int i = 0; i < refs_.size(); i++) {
-        output.writeSInt64NoTag(refs_.get(i));
+        output.writeSInt64NoTag(refs_.getLong(i));
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -10791,7 +10864,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < keys_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeUInt32SizeNoTag(keys_.get(i));
+            .computeUInt32SizeNoTag(keys_.getInt(i));
         }
         size += dataSize;
         if (!getKeysList().isEmpty()) {
@@ -10805,7 +10878,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < vals_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeUInt32SizeNoTag(vals_.get(i));
+            .computeUInt32SizeNoTag(vals_.getInt(i));
         }
         size += dataSize;
         if (!getValsList().isEmpty()) {
@@ -10817,13 +10890,13 @@ public final class Osmformat {
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(4, info_);
+          .computeMessageSize(4, getInfo());
       }
       {
         int dataSize = 0;
         for (int i = 0; i < refs_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt64SizeNoTag(refs_.get(i));
+            .computeSInt64SizeNoTag(refs_.getLong(i));
         }
         size += dataSize;
         if (!getRefsList().isEmpty()) {
@@ -10833,399 +10906,240 @@ public final class Osmformat {
         }
         refsMemoizedSerializedSize = dataSize;
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.Way prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.Way}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.Way, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Way, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.Way)
         org.openstreetmap.osmosis.osmbinary.Osmformat.WayOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.Way.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        id_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        keys_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        vals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        refs_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Way getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.Way.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Way build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Way result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Way buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Way result = new org.openstreetmap.osmosis.osmbinary.Osmformat.Way(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.id_ = id_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = java.util.Collections.unmodifiableList(keys_);
-          bitField0_ = (bitField0_ & ~0x00000002);
-        }
-        result.keys_ = keys_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = java.util.Collections.unmodifiableList(vals_);
-          bitField0_ = (bitField0_ & ~0x00000004);
-        }
-        result.vals_ = vals_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.info_ = info_;
-        if (((bitField0_ & 0x00000010) == 0x00000010)) {
-          refs_ = java.util.Collections.unmodifiableList(refs_);
-          bitField0_ = (bitField0_ & ~0x00000010);
-        }
-        result.refs_ = refs_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.Way other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.Way.getDefaultInstance()) return this;
-        if (other.hasId()) {
-          setId(other.getId());
-        }
-        if (!other.keys_.isEmpty()) {
-          if (keys_.isEmpty()) {
-            keys_ = other.keys_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensureKeysIsMutable();
-            keys_.addAll(other.keys_);
-          }
-          
-        }
-        if (!other.vals_.isEmpty()) {
-          if (vals_.isEmpty()) {
-            vals_ = other.vals_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureValsIsMutable();
-            vals_.addAll(other.vals_);
-          }
-          
-        }
-        if (other.hasInfo()) {
-          mergeInfo(other.getInfo());
-        }
-        if (!other.refs_.isEmpty()) {
-          if (refs_.isEmpty()) {
-            refs_ = other.refs_;
-            bitField0_ = (bitField0_ & ~0x00000010);
-          } else {
-            ensureRefsIsMutable();
-            refs_.addAll(other.refs_);
-          }
-          
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        if (!hasId()) {
-          
-          return false;
-        }
-        return true;
+        super(DEFAULT_INSTANCE);
       }
 
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Way parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.Way) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private long id_ ;
       /**
        * <code>required int64 id = 1;</code>
        */
       public boolean hasId() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasId();
       }
       /**
        * <code>required int64 id = 1;</code>
        */
       public long getId() {
-        return id_;
+        return instance.getId();
       }
       /**
        * <code>required int64 id = 1;</code>
        */
       public Builder setId(long value) {
-        bitField0_ |= 0x00000001;
-        id_ = value;
-        
+        copyOnWrite();
+        instance.setId(value);
         return this;
       }
       /**
        * <code>required int64 id = 1;</code>
        */
       public Builder clearId() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        id_ = 0L;
-        
+        copyOnWrite();
+        instance.clearId();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> keys_ = java.util.Collections.emptyList();
-      private void ensureKeysIsMutable() {
-        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = new java.util.ArrayList<java.lang.Integer>(keys_);
-          bitField0_ |= 0x00000002;
-         }
-      }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getKeysList() {
-        return java.util.Collections.unmodifiableList(keys_);
+        return java.util.Collections.unmodifiableList(
+            instance.getKeysList());
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public int getKeysCount() {
-        return keys_.size();
+        return instance.getKeysCount();
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public int getKeys(int index) {
-        return keys_.get(index);
+        return instance.getKeys(index);
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder setKeys(
           int index, int value) {
-        ensureKeysIsMutable();
-        keys_.set(index, value);
-        
+        copyOnWrite();
+        instance.setKeys(index, value);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder addKeys(int value) {
-        ensureKeysIsMutable();
-        keys_.add(value);
-        
+        copyOnWrite();
+        instance.addKeys(value);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder addAllKeys(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureKeysIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, keys_);
-        
+        copyOnWrite();
+        instance.addAllKeys(values);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder clearKeys() {
-        keys_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        
+        copyOnWrite();
+        instance.clearKeys();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> vals_ = java.util.Collections.emptyList();
-      private void ensureValsIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = new java.util.ArrayList<java.lang.Integer>(vals_);
-          bitField0_ |= 0x00000004;
-         }
-      }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getValsList() {
-        return java.util.Collections.unmodifiableList(vals_);
+        return java.util.Collections.unmodifiableList(
+            instance.getValsList());
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public int getValsCount() {
-        return vals_.size();
+        return instance.getValsCount();
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public int getVals(int index) {
-        return vals_.get(index);
+        return instance.getVals(index);
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder setVals(
           int index, int value) {
-        ensureValsIsMutable();
-        vals_.set(index, value);
-        
+        copyOnWrite();
+        instance.setVals(index, value);
         return this;
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder addVals(int value) {
-        ensureValsIsMutable();
-        vals_.add(value);
-        
+        copyOnWrite();
+        instance.addVals(value);
         return this;
       }
       /**
@@ -11233,185 +11147,342 @@ public final class Osmformat {
        */
       public Builder addAllVals(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureValsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, vals_);
-        
+        copyOnWrite();
+        instance.addAllVals(values);
         return this;
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder clearVals() {
-        vals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        
+        copyOnWrite();
+        instance.clearVals();
         return this;
       }
 
-      private org.openstreetmap.osmosis.osmbinary.Osmformat.Info info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public boolean hasInfo() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasInfo();
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo() {
-        return info_;
+        return instance.getInfo();
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder setInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        info_ = value;
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.setInfo(value);
         return this;
-      }
+        }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder setInfo(
           org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder builderForValue) {
-        info_ = builderForValue.build();
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.setInfo(builderForValue);
         return this;
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder mergeInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
-        if (((bitField0_ & 0x00000008) == 0x00000008) &&
-            info_ != org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance()) {
-          info_ =
-            org.openstreetmap.osmosis.osmbinary.Osmformat.Info.newBuilder(info_).mergeFrom(value).buildPartial();
-        } else {
-          info_ = value;
-        }
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.mergeInfo(value);
         return this;
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
-      public Builder clearInfo() {
-        info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-
-        bitField0_ = (bitField0_ & ~0x00000008);
+      public Builder clearInfo() {  copyOnWrite();
+        instance.clearInfo();
         return this;
       }
 
-      private java.util.List<java.lang.Long> refs_ = java.util.Collections.emptyList();
-      private void ensureRefsIsMutable() {
-        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
-          refs_ = new java.util.ArrayList<java.lang.Long>(refs_);
-          bitField0_ |= 0x00000010;
-         }
-      }
       /**
-       * <code>repeated sint64 refs = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 refs = 8 [packed = true];</code>
        */
       public java.util.List<java.lang.Long>
           getRefsList() {
-        return java.util.Collections.unmodifiableList(refs_);
+        return java.util.Collections.unmodifiableList(
+            instance.getRefsList());
       }
       /**
-       * <code>repeated sint64 refs = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 refs = 8 [packed = true];</code>
        */
       public int getRefsCount() {
-        return refs_.size();
+        return instance.getRefsCount();
       }
       /**
-       * <code>repeated sint64 refs = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 refs = 8 [packed = true];</code>
        */
       public long getRefs(int index) {
-        return refs_.get(index);
+        return instance.getRefs(index);
       }
       /**
-       * <code>repeated sint64 refs = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 refs = 8 [packed = true];</code>
        */
       public Builder setRefs(
           int index, long value) {
-        ensureRefsIsMutable();
-        refs_.set(index, value);
-        
+        copyOnWrite();
+        instance.setRefs(index, value);
         return this;
       }
       /**
-       * <code>repeated sint64 refs = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 refs = 8 [packed = true];</code>
        */
       public Builder addRefs(long value) {
-        ensureRefsIsMutable();
-        refs_.add(value);
-        
+        copyOnWrite();
+        instance.addRefs(value);
         return this;
       }
       /**
-       * <code>repeated sint64 refs = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 refs = 8 [packed = true];</code>
        */
       public Builder addAllRefs(
           java.lang.Iterable<? extends java.lang.Long> values) {
-        ensureRefsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, refs_);
-        
+        copyOnWrite();
+        instance.addAllRefs(values);
         return this;
       }
       /**
-       * <code>repeated sint64 refs = 8 [packed = true];</code>
-       *
        * <pre>
        * DELTA coded
        * </pre>
+       *
+       * <code>repeated sint64 refs = 8 [packed = true];</code>
        */
       public Builder clearRefs() {
-        refs_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        
+        copyOnWrite();
+        instance.clearRefs();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.Way)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.Way();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (!hasId()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
+
+        }
+        case MAKE_IMMUTABLE: {
+          keys_.makeImmutable();
+          vals_.makeImmutable();
+          refs_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Way other = (org.openstreetmap.osmosis.osmbinary.Osmformat.Way) arg1;
+          id_ = visitor.visitLong(
+              hasId(), id_,
+              other.hasId(), other.id_);
+          keys_= visitor.visitIntList(keys_, other.keys_);
+          vals_= visitor.visitIntList(vals_, other.vals_);
+          info_ = visitor.visitMessage(info_, other.info_);
+          refs_= visitor.visitLongList(refs_, other.refs_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  bitField0_ |= 0x00000001;
+                  id_ = input.readInt64();
+                  break;
+                }
+                case 16: {
+                  if (!keys_.isModifiable()) {
+                    keys_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+                  }
+                  keys_.addInt(input.readUInt32());
+                  break;
+                }
+                case 18: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!keys_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    keys_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    keys_.addInt(input.readUInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 24: {
+                  if (!vals_.isModifiable()) {
+                    vals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+                  }
+                  vals_.addInt(input.readUInt32());
+                  break;
+                }
+                case 26: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!vals_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    vals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    vals_.addInt(input.readUInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 34: {
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder subBuilder = null;
+                  if (((bitField0_ & 0x00000002) == 0x00000002)) {
+                    subBuilder = info_.toBuilder();
+                  }
+                  info_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Info.parser(), extensionRegistry);
+                  if (subBuilder != null) {
+                    subBuilder.mergeFrom(info_);
+                    info_ = subBuilder.buildPartial();
+                  }
+                  bitField0_ |= 0x00000002;
+                  break;
+                }
+                case 64: {
+                  if (!refs_.isModifiable()) {
+                    refs_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(refs_);
+                  }
+                  refs_.addLong(input.readSInt64());
+                  break;
+                }
+                case 66: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!refs_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    refs_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(refs_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    refs_.addLong(input.readSInt64());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.Way.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
 
+
+    // @@protoc_insertion_point(class_scope:OSMPBF.Way)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.Way DEFAULT_INSTANCE;
     static {
-      defaultInstance = new Way(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new Way();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.Way)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.Way getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<Way> PARSER;
+
+    public static com.google.protobuf.Parser<Way> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
   public interface RelationOrBuilder extends
@@ -11428,27 +11499,27 @@ public final class Osmformat {
     long getId();
 
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getKeysList();
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     int getKeysCount();
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     int getKeys(int index);
 
@@ -11474,53 +11545,53 @@ public final class Osmformat {
      */
     org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo();
 
-    /**
-     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-     *
+    /**
      * <pre>
      * Parallel arrays
      * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
      */
     java.util.List<java.lang.Integer> getRolesSidList();
     /**
-     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays
      * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
      */
     int getRolesSidCount();
     /**
-     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays
      * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
      */
     int getRolesSid(int index);
 
     /**
-     * <code>repeated sint64 memids = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA encoded
      * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
      */
     java.util.List<java.lang.Long> getMemidsList();
     /**
-     * <code>repeated sint64 memids = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA encoded
      * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
      */
     int getMemidsCount();
     /**
-     * <code>repeated sint64 memids = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA encoded
      * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
      */
     long getMemids(int index);
 
@@ -11540,238 +11611,18 @@ public final class Osmformat {
   /**
    * Protobuf type {@code OSMPBF.Relation}
    */
-  public static final class Relation extends
-      com.google.protobuf.GeneratedMessageLite implements
+  public  static final class Relation extends
+      com.google.protobuf.GeneratedMessageLite<
+          Relation, Relation.Builder> implements
       // @@protoc_insertion_point(message_implements:OSMPBF.Relation)
       RelationOrBuilder {
-    // Use Relation.newBuilder() to construct.
-    private Relation(com.google.protobuf.GeneratedMessageLite.Builder builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private Relation(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;}
-
-    private static final Relation defaultInstance;
-    public static Relation getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public Relation getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.ByteString unknownFields;
-    private Relation(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.ByteString.Output unknownFieldsOutput =
-          com.google.protobuf.ByteString.newOutput();
-      com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput =
-          com.google.protobuf.CodedOutputStream.newInstance(
-              unknownFieldsOutput);
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFieldsCodedOutput,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              bitField0_ |= 0x00000001;
-              id_ = input.readInt64();
-              break;
-            }
-            case 16: {
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                keys_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              keys_.add(input.readUInt32());
-              break;
-            }
-            case 18: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
-                keys_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000002;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                keys_.add(input.readUInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 24: {
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                vals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              vals_.add(input.readUInt32());
-              break;
-            }
-            case 26: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
-                vals_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000004;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                vals_.add(input.readUInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 34: {
-              org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000002) == 0x00000002)) {
-                subBuilder = info_.toBuilder();
-              }
-              info_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Info.PARSER, extensionRegistry);
-              if (subBuilder != null) {
-                subBuilder.mergeFrom(info_);
-                info_ = subBuilder.buildPartial();
-              }
-              bitField0_ |= 0x00000002;
-              break;
-            }
-            case 64: {
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-                rolesSid_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              rolesSid_.add(input.readInt32());
-              break;
-            }
-            case 66: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) {
-                rolesSid_ = new java.util.ArrayList<java.lang.Integer>();
-                mutable_bitField0_ |= 0x00000010;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                rolesSid_.add(input.readInt32());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 72: {
-              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
-                memids_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000020;
-              }
-              memids_.add(input.readSInt64());
-              break;
-            }
-            case 74: {
-              int length = input.readRawVarint32();
-              int limit = input.pushLimit(length);
-              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
-                memids_ = new java.util.ArrayList<java.lang.Long>();
-                mutable_bitField0_ |= 0x00000020;
-              }
-              while (input.getBytesUntilLimit() > 0) {
-                memids_.add(input.readSInt64());
-              }
-              input.popLimit(limit);
-              break;
-            }
-            case 80: {
-              int rawValue = input.readEnum();
-              org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value = org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType.valueOf(rawValue);
-              if (value == null) {
-                unknownFieldsCodedOutput.writeRawVarint32(tag);
-                unknownFieldsCodedOutput.writeRawVarint32(rawValue);
-                } else {
-                if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-                  types_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType>();
-                  mutable_bitField0_ |= 0x00000040;
-                }
-                types_.add(value);
-              }
-              break;
-            }
-            case 82: {
-              int length = input.readRawVarint32();
-              int oldLimit = input.pushLimit(length);
-              while(input.getBytesUntilLimit() > 0) {
-                int rawValue = input.readEnum();
-                org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value = org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType.valueOf(rawValue);
-                if (value == null) {
-                  unknownFieldsCodedOutput.writeRawVarint32(tag);
-                  unknownFieldsCodedOutput.writeRawVarint32(rawValue);
-                  } else {
-                  if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-                    types_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType>();
-                    mutable_bitField0_ |= 0x00000040;
-                  }
-                  types_.add(value);
-                }
-              }
-              input.popLimit(oldLimit);
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = java.util.Collections.unmodifiableList(keys_);
-        }
-        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = java.util.Collections.unmodifiableList(vals_);
-        }
-        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
-          rolesSid_ = java.util.Collections.unmodifiableList(rolesSid_);
-        }
-        if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
-          memids_ = java.util.Collections.unmodifiableList(memids_);
-        }
-        if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-          types_ = java.util.Collections.unmodifiableList(types_);
-        }
-        try {
-          unknownFieldsCodedOutput.flush();
-        } catch (java.io.IOException e) {
-        // Should not happen
-        } finally {
-          unknownFields = unknownFieldsOutput.toByteString();
-        }
-        makeExtensionsImmutable();
-      }
-    }
-    public static com.google.protobuf.Parser<Relation> PARSER =
-        new com.google.protobuf.AbstractParser<Relation>() {
-      public Relation parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new Relation(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<Relation> getParserForType() {
-      return PARSER;
+    private Relation() {
+      keys_ = emptyIntList();
+      vals_ = emptyIntList();
+      rolesSid_ = emptyIntList();
+      memids_ = emptyLongList();
+      types_ = emptyIntList();
     }
-
     /**
      * Protobuf enum {@code OSMPBF.Relation.MemberType}
      */
@@ -11780,15 +11631,15 @@ public final class Osmformat {
       /**
        * <code>NODE = 0;</code>
        */
-      NODE(0, 0),
+      NODE(0),
       /**
        * <code>WAY = 1;</code>
        */
-      WAY(1, 1),
+      WAY(1),
       /**
        * <code>RELATION = 2;</code>
        */
-      RELATION(2, 2),
+      RELATION(2),
       ;
 
       /**
@@ -11805,9 +11656,19 @@ public final class Osmformat {
       public static final int RELATION_VALUE = 2;
 
 
-      public final int getNumber() { return value; }
+      public final int getNumber() {
+        return value;
+      }
 
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
       public static MemberType valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static MemberType forNumber(int value) {
         switch (value) {
           case 0: return NODE;
           case 1: return WAY;
@@ -11820,17 +11681,17 @@ public final class Osmformat {
           internalGetValueMap() {
         return internalValueMap;
       }
-      private static com.google.protobuf.Internal.EnumLiteMap<MemberType>
-          internalValueMap =
+      private static final com.google.protobuf.Internal.EnumLiteMap<
+          MemberType> internalValueMap =
             new com.google.protobuf.Internal.EnumLiteMap<MemberType>() {
               public MemberType findValueByNumber(int number) {
-                return MemberType.valueOf(number);
+                return MemberType.forNumber(number);
               }
             };
 
       private final int value;
 
-      private MemberType(int index, int value) {
+      private MemberType(int value) {
         this.value = value;
       }
 
@@ -11852,44 +11713,110 @@ public final class Osmformat {
     public long getId() {
       return id_;
     }
+    /**
+     * <code>required int64 id = 1;</code>
+     */
+    private void setId(long value) {
+      bitField0_ |= 0x00000001;
+      id_ = value;
+    }
+    /**
+     * <code>required int64 id = 1;</code>
+     */
+    private void clearId() {
+      bitField0_ = (bitField0_ & ~0x00000001);
+      id_ = 0L;
+    }
 
     public static final int KEYS_FIELD_NUMBER = 2;
-    private java.util.List<java.lang.Integer> keys_;
+    private com.google.protobuf.Internal.IntList keys_;
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     public java.util.List<java.lang.Integer>
         getKeysList() {
       return keys_;
     }
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     public int getKeysCount() {
       return keys_.size();
     }
     /**
-     * <code>repeated uint32 keys = 2 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays.
      * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
      */
     public int getKeys(int index) {
-      return keys_.get(index);
+      return keys_.getInt(index);
     }
     private int keysMemoizedSerializedSize = -1;
+    private void ensureKeysIsMutable() {
+      if (!keys_.isModifiable()) {
+        keys_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+       }
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void setKeys(
+        int index, int value) {
+      ensureKeysIsMutable();
+      keys_.setInt(index, value);
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void addKeys(int value) {
+      ensureKeysIsMutable();
+      keys_.addInt(value);
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void addAllKeys(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureKeysIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, keys_);
+    }
+    /**
+     * <pre>
+     * Parallel arrays.
+     * </pre>
+     *
+     * <code>repeated uint32 keys = 2 [packed = true];</code>
+     */
+    private void clearKeys() {
+      keys_ = emptyIntList();
+    }
 
     public static final int VALS_FIELD_NUMBER = 3;
-    private java.util.List<java.lang.Integer> vals_;
+    private com.google.protobuf.Internal.IntList vals_;
     /**
      * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
@@ -11907,9 +11834,45 @@ public final class Osmformat {
      * <code>repeated uint32 vals = 3 [packed = true];</code>
      */
     public int getVals(int index) {
-      return vals_.get(index);
+      return vals_.getInt(index);
     }
     private int valsMemoizedSerializedSize = -1;
+    private void ensureValsIsMutable() {
+      if (!vals_.isModifiable()) {
+        vals_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+       }
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void setVals(
+        int index, int value) {
+      ensureValsIsMutable();
+      vals_.setInt(index, value);
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void addVals(int value) {
+      ensureValsIsMutable();
+      vals_.addInt(value);
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void addAllVals(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureValsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, vals_);
+    }
+    /**
+     * <code>repeated uint32 vals = 3 [packed = true];</code>
+     */
+    private void clearVals() {
+      vals_ = emptyIntList();
+    }
 
     public static final int INFO_FIELD_NUMBER = 4;
     private org.openstreetmap.osmosis.osmbinary.Osmformat.Info info_;
@@ -11923,86 +11886,237 @@ public final class Osmformat {
      * <code>optional .OSMPBF.Info info = 4;</code>
      */
     public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo() {
-      return info_;
+      return info_ == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance() : info_;
+    }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void setInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      info_ = value;
+      bitField0_ |= 0x00000002;
+      }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void setInfo(
+        org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder builderForValue) {
+      info_ = builderForValue.build();
+      bitField0_ |= 0x00000002;
+    }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void mergeInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
+      if (info_ != null &&
+          info_ != org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance()) {
+        info_ =
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Info.newBuilder(info_).mergeFrom(value).buildPartial();
+      } else {
+        info_ = value;
+      }
+      bitField0_ |= 0x00000002;
+    }
+    /**
+     * <code>optional .OSMPBF.Info info = 4;</code>
+     */
+    private void clearInfo() {  info_ = null;
+      bitField0_ = (bitField0_ & ~0x00000002);
     }
 
     public static final int ROLES_SID_FIELD_NUMBER = 8;
-    private java.util.List<java.lang.Integer> rolesSid_;
+    private com.google.protobuf.Internal.IntList rolesSid_;
     /**
-     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays
      * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
      */
     public java.util.List<java.lang.Integer>
         getRolesSidList() {
       return rolesSid_;
     }
     /**
-     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-     *
      * <pre>
      * Parallel arrays
      * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
      */
     public int getRolesSidCount() {
       return rolesSid_.size();
     }
     /**
-     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-     *
      * <pre>
-     * Parallel arrays
+     * Parallel arrays
+     * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
+     */
+    public int getRolesSid(int index) {
+      return rolesSid_.getInt(index);
+    }
+    private int rolesSidMemoizedSerializedSize = -1;
+    private void ensureRolesSidIsMutable() {
+      if (!rolesSid_.isModifiable()) {
+        rolesSid_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(rolesSid_);
+       }
+    }
+    /**
+     * <pre>
+     * Parallel arrays
+     * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
+     */
+    private void setRolesSid(
+        int index, int value) {
+      ensureRolesSidIsMutable();
+      rolesSid_.setInt(index, value);
+    }
+    /**
+     * <pre>
+     * Parallel arrays
+     * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
+     */
+    private void addRolesSid(int value) {
+      ensureRolesSidIsMutable();
+      rolesSid_.addInt(value);
+    }
+    /**
+     * <pre>
+     * Parallel arrays
+     * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
+     */
+    private void addAllRolesSid(
+        java.lang.Iterable<? extends java.lang.Integer> values) {
+      ensureRolesSidIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, rolesSid_);
+    }
+    /**
+     * <pre>
+     * Parallel arrays
+     * </pre>
+     *
+     * <code>repeated int32 roles_sid = 8 [packed = true];</code>
+     */
+    private void clearRolesSid() {
+      rolesSid_ = emptyIntList();
+    }
+
+    public static final int MEMIDS_FIELD_NUMBER = 9;
+    private com.google.protobuf.Internal.LongList memids_;
+    /**
+     * <pre>
+     * DELTA encoded
+     * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
+     */
+    public java.util.List<java.lang.Long>
+        getMemidsList() {
+      return memids_;
+    }
+    /**
+     * <pre>
+     * DELTA encoded
+     * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
+     */
+    public int getMemidsCount() {
+      return memids_.size();
+    }
+    /**
+     * <pre>
+     * DELTA encoded
+     * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
+     */
+    public long getMemids(int index) {
+      return memids_.getLong(index);
+    }
+    private int memidsMemoizedSerializedSize = -1;
+    private void ensureMemidsIsMutable() {
+      if (!memids_.isModifiable()) {
+        memids_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(memids_);
+       }
+    }
+    /**
+     * <pre>
+     * DELTA encoded
      * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
      */
-    public int getRolesSid(int index) {
-      return rolesSid_.get(index);
+    private void setMemids(
+        int index, long value) {
+      ensureMemidsIsMutable();
+      memids_.setLong(index, value);
     }
-    private int rolesSidMemoizedSerializedSize = -1;
-
-    public static final int MEMIDS_FIELD_NUMBER = 9;
-    private java.util.List<java.lang.Long> memids_;
     /**
-     * <code>repeated sint64 memids = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA encoded
      * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
      */
-    public java.util.List<java.lang.Long>
-        getMemidsList() {
-      return memids_;
+    private void addMemids(long value) {
+      ensureMemidsIsMutable();
+      memids_.addLong(value);
     }
     /**
-     * <code>repeated sint64 memids = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA encoded
      * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
      */
-    public int getMemidsCount() {
-      return memids_.size();
+    private void addAllMemids(
+        java.lang.Iterable<? extends java.lang.Long> values) {
+      ensureMemidsIsMutable();
+      com.google.protobuf.AbstractMessageLite.addAll(
+          values, memids_);
     }
     /**
-     * <code>repeated sint64 memids = 9 [packed = true];</code>
-     *
      * <pre>
      * DELTA encoded
      * </pre>
+     *
+     * <code>repeated sint64 memids = 9 [packed = true];</code>
      */
-    public long getMemids(int index) {
-      return memids_.get(index);
+    private void clearMemids() {
+      memids_ = emptyLongList();
     }
-    private int memidsMemoizedSerializedSize = -1;
 
     public static final int TYPES_FIELD_NUMBER = 10;
-    private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType> types_;
+    private com.google.protobuf.Internal.IntList types_;
+    private static final com.google.protobuf.Internal.ListAdapter.Converter<
+        java.lang.Integer, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType> types_converter_ =
+            new com.google.protobuf.Internal.ListAdapter.Converter<
+                java.lang.Integer, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType>() {
+              public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType convert(java.lang.Integer from) {
+                org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType result = org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType.forNumber(from);
+                return result == null ? org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType.NODE : result;
+              }
+            };
     /**
      * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
      */
     public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType> getTypesList() {
-      return types_;
+      return new com.google.protobuf.Internal.ListAdapter<
+          java.lang.Integer, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType>(types_, types_converter_);
     }
     /**
      * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
@@ -12014,31 +12128,51 @@ public final class Osmformat {
      * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
      */
     public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType getTypes(int index) {
-      return types_.get(index);
+      return types_converter_.convert(types_.getInt(index));
     }
     private int typesMemoizedSerializedSize;
-
-    private void initFields() {
-      id_ = 0L;
-      keys_ = java.util.Collections.emptyList();
-      vals_ = java.util.Collections.emptyList();
-      info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-      rolesSid_ = java.util.Collections.emptyList();
-      memids_ = java.util.Collections.emptyList();
-      types_ = java.util.Collections.emptyList();
+    private void ensureTypesIsMutable() {
+      if (!types_.isModifiable()) {
+        types_ =
+            com.google.protobuf.GeneratedMessageLite.mutableCopy(types_);
+      }
     }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized == 1) return true;
-      if (isInitialized == 0) return false;
-
-      if (!hasId()) {
-        memoizedIsInitialized = 0;
-        return false;
+    /**
+     * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
+     */
+    private void setTypes(
+        int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      ensureTypesIsMutable();
+      types_.setInt(index, value.getNumber());
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
+     */
+    private void addTypes(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      memoizedIsInitialized = 1;
-      return true;
+      ensureTypesIsMutable();
+      types_.addInt(value.getNumber());
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
+     */
+    private void addAllTypes(
+        java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType> values) {
+      ensureTypesIsMutable();
+      for (org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value : values) {
+        types_.addInt(value.getNumber());
+      }
+    }
+    /**
+     * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
+     */
+    private void clearTypes() {
+      types_ = emptyIntList();
     }
 
     public void writeTo(com.google.protobuf.CodedOutputStream output)
@@ -12048,47 +12182,46 @@ public final class Osmformat {
         output.writeInt64(1, id_);
       }
       if (getKeysList().size() > 0) {
-        output.writeRawVarint32(18);
-        output.writeRawVarint32(keysMemoizedSerializedSize);
+        output.writeUInt32NoTag(18);
+        output.writeUInt32NoTag(keysMemoizedSerializedSize);
       }
       for (int i = 0; i < keys_.size(); i++) {
-        output.writeUInt32NoTag(keys_.get(i));
+        output.writeUInt32NoTag(keys_.getInt(i));
       }
       if (getValsList().size() > 0) {
-        output.writeRawVarint32(26);
-        output.writeRawVarint32(valsMemoizedSerializedSize);
+        output.writeUInt32NoTag(26);
+        output.writeUInt32NoTag(valsMemoizedSerializedSize);
       }
       for (int i = 0; i < vals_.size(); i++) {
-        output.writeUInt32NoTag(vals_.get(i));
+        output.writeUInt32NoTag(vals_.getInt(i));
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
-        output.writeMessage(4, info_);
+        output.writeMessage(4, getInfo());
       }
       if (getRolesSidList().size() > 0) {
-        output.writeRawVarint32(66);
-        output.writeRawVarint32(rolesSidMemoizedSerializedSize);
+        output.writeUInt32NoTag(66);
+        output.writeUInt32NoTag(rolesSidMemoizedSerializedSize);
       }
       for (int i = 0; i < rolesSid_.size(); i++) {
-        output.writeInt32NoTag(rolesSid_.get(i));
+        output.writeInt32NoTag(rolesSid_.getInt(i));
       }
       if (getMemidsList().size() > 0) {
-        output.writeRawVarint32(74);
-        output.writeRawVarint32(memidsMemoizedSerializedSize);
+        output.writeUInt32NoTag(74);
+        output.writeUInt32NoTag(memidsMemoizedSerializedSize);
       }
       for (int i = 0; i < memids_.size(); i++) {
-        output.writeSInt64NoTag(memids_.get(i));
+        output.writeSInt64NoTag(memids_.getLong(i));
       }
       if (getTypesList().size() > 0) {
-        output.writeRawVarint32(82);
-        output.writeRawVarint32(typesMemoizedSerializedSize);
+        output.writeUInt32NoTag(82);
+        output.writeUInt32NoTag(typesMemoizedSerializedSize);
       }
       for (int i = 0; i < types_.size(); i++) {
-        output.writeEnumNoTag(types_.get(i).getNumber());
+        output.writeEnumNoTag(types_.getInt(i));
       }
-      output.writeRawBytes(unknownFields);
+      unknownFields.writeTo(output);
     }
 
-    private int memoizedSerializedSize = -1;
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
       if (size != -1) return size;
@@ -12102,7 +12235,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < keys_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeUInt32SizeNoTag(keys_.get(i));
+            .computeUInt32SizeNoTag(keys_.getInt(i));
         }
         size += dataSize;
         if (!getKeysList().isEmpty()) {
@@ -12116,7 +12249,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < vals_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeUInt32SizeNoTag(vals_.get(i));
+            .computeUInt32SizeNoTag(vals_.getInt(i));
         }
         size += dataSize;
         if (!getValsList().isEmpty()) {
@@ -12128,13 +12261,13 @@ public final class Osmformat {
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(4, info_);
+          .computeMessageSize(4, getInfo());
       }
       {
         int dataSize = 0;
         for (int i = 0; i < rolesSid_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeInt32SizeNoTag(rolesSid_.get(i));
+            .computeInt32SizeNoTag(rolesSid_.getInt(i));
         }
         size += dataSize;
         if (!getRolesSidList().isEmpty()) {
@@ -12148,7 +12281,7 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < memids_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeSInt64SizeNoTag(memids_.get(i));
+            .computeSInt64SizeNoTag(memids_.getLong(i));
         }
         size += dataSize;
         if (!getMemidsList().isEmpty()) {
@@ -12162,441 +12295,248 @@ public final class Osmformat {
         int dataSize = 0;
         for (int i = 0; i < types_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeEnumSizeNoTag(types_.get(i).getNumber());
+            .computeEnumSizeNoTag(types_.getInt(i));
         }
         size += dataSize;
         if (!getTypesList().isEmpty()) {  size += 1;
           size += com.google.protobuf.CodedOutputStream
-            .computeRawVarint32Size(dataSize);
+            .computeUInt32SizeNoTag(dataSize);
         }typesMemoizedSerializedSize = dataSize;
       }
-      size += unknownFields.size();
+      size += unknownFields.getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
 
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, data, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
-      return PARSER.parseFrom(input);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input);
     }
     public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
+      return com.google.protobuf.GeneratedMessageLite.parseFrom(
+          DEFAULT_INSTANCE, input, extensionRegistry);
     }
 
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
     public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation prototype) {
-      return newBuilder().mergeFrom(prototype);
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
-    public Builder toBuilder() { return newBuilder(this); }
 
     /**
      * Protobuf type {@code OSMPBF.Relation}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.Builder<
-          org.openstreetmap.osmosis.osmbinary.Osmformat.Relation, Builder>
-        implements
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Relation, Builder> implements
         // @@protoc_insertion_point(builder_implements:OSMPBF.Relation)
         org.openstreetmap.osmosis.osmbinary.Osmformat.RelationOrBuilder {
       // Construct using org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private void maybeForceBuilderInitialization() {
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        id_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        keys_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        vals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-        bitField0_ = (bitField0_ & ~0x00000008);
-        rolesSid_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        memids_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000020);
-        types_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000040);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation getDefaultInstanceForType() {
-        return org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.getDefaultInstance();
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation build() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Relation result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation buildPartial() {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Relation result = new org.openstreetmap.osmosis.osmbinary.Osmformat.Relation(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.id_ = id_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = java.util.Collections.unmodifiableList(keys_);
-          bitField0_ = (bitField0_ & ~0x00000002);
-        }
-        result.keys_ = keys_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = java.util.Collections.unmodifiableList(vals_);
-          bitField0_ = (bitField0_ & ~0x00000004);
-        }
-        result.vals_ = vals_;
-        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.info_ = info_;
-        if (((bitField0_ & 0x00000010) == 0x00000010)) {
-          rolesSid_ = java.util.Collections.unmodifiableList(rolesSid_);
-          bitField0_ = (bitField0_ & ~0x00000010);
-        }
-        result.rolesSid_ = rolesSid_;
-        if (((bitField0_ & 0x00000020) == 0x00000020)) {
-          memids_ = java.util.Collections.unmodifiableList(memids_);
-          bitField0_ = (bitField0_ & ~0x00000020);
-        }
-        result.memids_ = memids_;
-        if (((bitField0_ & 0x00000040) == 0x00000040)) {
-          types_ = java.util.Collections.unmodifiableList(types_);
-          bitField0_ = (bitField0_ & ~0x00000040);
-        }
-        result.types_ = types_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation other) {
-        if (other == org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.getDefaultInstance()) return this;
-        if (other.hasId()) {
-          setId(other.getId());
-        }
-        if (!other.keys_.isEmpty()) {
-          if (keys_.isEmpty()) {
-            keys_ = other.keys_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensureKeysIsMutable();
-            keys_.addAll(other.keys_);
-          }
-          
-        }
-        if (!other.vals_.isEmpty()) {
-          if (vals_.isEmpty()) {
-            vals_ = other.vals_;
-            bitField0_ = (bitField0_ & ~0x00000004);
-          } else {
-            ensureValsIsMutable();
-            vals_.addAll(other.vals_);
-          }
-          
-        }
-        if (other.hasInfo()) {
-          mergeInfo(other.getInfo());
-        }
-        if (!other.rolesSid_.isEmpty()) {
-          if (rolesSid_.isEmpty()) {
-            rolesSid_ = other.rolesSid_;
-            bitField0_ = (bitField0_ & ~0x00000010);
-          } else {
-            ensureRolesSidIsMutable();
-            rolesSid_.addAll(other.rolesSid_);
-          }
-          
-        }
-        if (!other.memids_.isEmpty()) {
-          if (memids_.isEmpty()) {
-            memids_ = other.memids_;
-            bitField0_ = (bitField0_ & ~0x00000020);
-          } else {
-            ensureMemidsIsMutable();
-            memids_.addAll(other.memids_);
-          }
-          
-        }
-        if (!other.types_.isEmpty()) {
-          if (types_.isEmpty()) {
-            types_ = other.types_;
-            bitField0_ = (bitField0_ & ~0x00000040);
-          } else {
-            ensureTypesIsMutable();
-            types_.addAll(other.types_);
-          }
-          
-        }
-        setUnknownFields(
-            getUnknownFields().concat(other.unknownFields));
-        return this;
+        super(DEFAULT_INSTANCE);
       }
 
-      public final boolean isInitialized() {
-        if (!hasId()) {
-          
-          return false;
-        }
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.openstreetmap.osmosis.osmbinary.Osmformat.Relation parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.openstreetmap.osmosis.osmbinary.Osmformat.Relation) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
 
-      private long id_ ;
       /**
        * <code>required int64 id = 1;</code>
        */
       public boolean hasId() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
+        return instance.hasId();
       }
       /**
        * <code>required int64 id = 1;</code>
        */
       public long getId() {
-        return id_;
+        return instance.getId();
       }
       /**
        * <code>required int64 id = 1;</code>
        */
       public Builder setId(long value) {
-        bitField0_ |= 0x00000001;
-        id_ = value;
-        
+        copyOnWrite();
+        instance.setId(value);
         return this;
       }
       /**
        * <code>required int64 id = 1;</code>
        */
       public Builder clearId() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        id_ = 0L;
-        
+        copyOnWrite();
+        instance.clearId();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> keys_ = java.util.Collections.emptyList();
-      private void ensureKeysIsMutable() {
-        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          keys_ = new java.util.ArrayList<java.lang.Integer>(keys_);
-          bitField0_ |= 0x00000002;
-         }
-      }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getKeysList() {
-        return java.util.Collections.unmodifiableList(keys_);
+        return java.util.Collections.unmodifiableList(
+            instance.getKeysList());
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public int getKeysCount() {
-        return keys_.size();
+        return instance.getKeysCount();
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public int getKeys(int index) {
-        return keys_.get(index);
+        return instance.getKeys(index);
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder setKeys(
           int index, int value) {
-        ensureKeysIsMutable();
-        keys_.set(index, value);
-        
+        copyOnWrite();
+        instance.setKeys(index, value);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder addKeys(int value) {
-        ensureKeysIsMutable();
-        keys_.add(value);
-        
+        copyOnWrite();
+        instance.addKeys(value);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder addAllKeys(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureKeysIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, keys_);
-        
+        copyOnWrite();
+        instance.addAllKeys(values);
         return this;
       }
       /**
-       * <code>repeated uint32 keys = 2 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays.
        * </pre>
+       *
+       * <code>repeated uint32 keys = 2 [packed = true];</code>
        */
       public Builder clearKeys() {
-        keys_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000002);
-        
+        copyOnWrite();
+        instance.clearKeys();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> vals_ = java.util.Collections.emptyList();
-      private void ensureValsIsMutable() {
-        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          vals_ = new java.util.ArrayList<java.lang.Integer>(vals_);
-          bitField0_ |= 0x00000004;
-         }
-      }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getValsList() {
-        return java.util.Collections.unmodifiableList(vals_);
+        return java.util.Collections.unmodifiableList(
+            instance.getValsList());
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public int getValsCount() {
-        return vals_.size();
+        return instance.getValsCount();
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public int getVals(int index) {
-        return vals_.get(index);
+        return instance.getVals(index);
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder setVals(
           int index, int value) {
-        ensureValsIsMutable();
-        vals_.set(index, value);
-        
+        copyOnWrite();
+        instance.setVals(index, value);
         return this;
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder addVals(int value) {
-        ensureValsIsMutable();
-        vals_.add(value);
-        
+        copyOnWrite();
+        instance.addVals(value);
         return this;
       }
       /**
@@ -12604,319 +12544,263 @@ public final class Osmformat {
        */
       public Builder addAllVals(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureValsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, vals_);
-        
+        copyOnWrite();
+        instance.addAllVals(values);
         return this;
       }
       /**
        * <code>repeated uint32 vals = 3 [packed = true];</code>
        */
       public Builder clearVals() {
-        vals_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000004);
-        
+        copyOnWrite();
+        instance.clearVals();
         return this;
       }
 
-      private org.openstreetmap.osmosis.osmbinary.Osmformat.Info info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public boolean hasInfo() {
-        return ((bitField0_ & 0x00000008) == 0x00000008);
+        return instance.hasInfo();
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.Info getInfo() {
-        return info_;
+        return instance.getInfo();
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder setInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        info_ = value;
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.setInfo(value);
         return this;
-      }
+        }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder setInfo(
           org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder builderForValue) {
-        info_ = builderForValue.build();
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.setInfo(builderForValue);
         return this;
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
       public Builder mergeInfo(org.openstreetmap.osmosis.osmbinary.Osmformat.Info value) {
-        if (((bitField0_ & 0x00000008) == 0x00000008) &&
-            info_ != org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance()) {
-          info_ =
-            org.openstreetmap.osmosis.osmbinary.Osmformat.Info.newBuilder(info_).mergeFrom(value).buildPartial();
-        } else {
-          info_ = value;
-        }
-
-        bitField0_ |= 0x00000008;
+        copyOnWrite();
+        instance.mergeInfo(value);
         return this;
       }
       /**
        * <code>optional .OSMPBF.Info info = 4;</code>
        */
-      public Builder clearInfo() {
-        info_ = org.openstreetmap.osmosis.osmbinary.Osmformat.Info.getDefaultInstance();
-
-        bitField0_ = (bitField0_ & ~0x00000008);
+      public Builder clearInfo() {  copyOnWrite();
+        instance.clearInfo();
         return this;
       }
 
-      private java.util.List<java.lang.Integer> rolesSid_ = java.util.Collections.emptyList();
-      private void ensureRolesSidIsMutable() {
-        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
-          rolesSid_ = new java.util.ArrayList<java.lang.Integer>(rolesSid_);
-          bitField0_ |= 0x00000010;
-         }
-      }
       /**
-       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays
        * </pre>
+       *
+       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
        */
       public java.util.List<java.lang.Integer>
           getRolesSidList() {
-        return java.util.Collections.unmodifiableList(rolesSid_);
+        return java.util.Collections.unmodifiableList(
+            instance.getRolesSidList());
       }
       /**
-       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays
        * </pre>
+       *
+       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
        */
       public int getRolesSidCount() {
-        return rolesSid_.size();
+        return instance.getRolesSidCount();
       }
       /**
-       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays
        * </pre>
+       *
+       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
        */
       public int getRolesSid(int index) {
-        return rolesSid_.get(index);
+        return instance.getRolesSid(index);
       }
       /**
-       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays
        * </pre>
+       *
+       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
        */
       public Builder setRolesSid(
           int index, int value) {
-        ensureRolesSidIsMutable();
-        rolesSid_.set(index, value);
-        
+        copyOnWrite();
+        instance.setRolesSid(index, value);
         return this;
       }
       /**
-       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays
        * </pre>
+       *
+       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
        */
       public Builder addRolesSid(int value) {
-        ensureRolesSidIsMutable();
-        rolesSid_.add(value);
-        
+        copyOnWrite();
+        instance.addRolesSid(value);
         return this;
       }
       /**
-       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays
        * </pre>
+       *
+       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
        */
       public Builder addAllRolesSid(
           java.lang.Iterable<? extends java.lang.Integer> values) {
-        ensureRolesSidIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, rolesSid_);
-        
+        copyOnWrite();
+        instance.addAllRolesSid(values);
         return this;
       }
       /**
-       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
-       *
        * <pre>
        * Parallel arrays
        * </pre>
+       *
+       * <code>repeated int32 roles_sid = 8 [packed = true];</code>
        */
       public Builder clearRolesSid() {
-        rolesSid_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000010);
-        
+        copyOnWrite();
+        instance.clearRolesSid();
         return this;
       }
 
-      private java.util.List<java.lang.Long> memids_ = java.util.Collections.emptyList();
-      private void ensureMemidsIsMutable() {
-        if (!((bitField0_ & 0x00000020) == 0x00000020)) {
-          memids_ = new java.util.ArrayList<java.lang.Long>(memids_);
-          bitField0_ |= 0x00000020;
-         }
-      }
       /**
-       * <code>repeated sint64 memids = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA encoded
        * </pre>
+       *
+       * <code>repeated sint64 memids = 9 [packed = true];</code>
        */
       public java.util.List<java.lang.Long>
           getMemidsList() {
-        return java.util.Collections.unmodifiableList(memids_);
+        return java.util.Collections.unmodifiableList(
+            instance.getMemidsList());
       }
       /**
-       * <code>repeated sint64 memids = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA encoded
        * </pre>
+       *
+       * <code>repeated sint64 memids = 9 [packed = true];</code>
        */
       public int getMemidsCount() {
-        return memids_.size();
+        return instance.getMemidsCount();
       }
       /**
-       * <code>repeated sint64 memids = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA encoded
        * </pre>
+       *
+       * <code>repeated sint64 memids = 9 [packed = true];</code>
        */
       public long getMemids(int index) {
-        return memids_.get(index);
+        return instance.getMemids(index);
       }
       /**
-       * <code>repeated sint64 memids = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA encoded
        * </pre>
+       *
+       * <code>repeated sint64 memids = 9 [packed = true];</code>
        */
       public Builder setMemids(
           int index, long value) {
-        ensureMemidsIsMutable();
-        memids_.set(index, value);
-        
+        copyOnWrite();
+        instance.setMemids(index, value);
         return this;
       }
       /**
-       * <code>repeated sint64 memids = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA encoded
        * </pre>
+       *
+       * <code>repeated sint64 memids = 9 [packed = true];</code>
        */
       public Builder addMemids(long value) {
-        ensureMemidsIsMutable();
-        memids_.add(value);
-        
+        copyOnWrite();
+        instance.addMemids(value);
         return this;
       }
       /**
-       * <code>repeated sint64 memids = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA encoded
        * </pre>
+       *
+       * <code>repeated sint64 memids = 9 [packed = true];</code>
        */
       public Builder addAllMemids(
           java.lang.Iterable<? extends java.lang.Long> values) {
-        ensureMemidsIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, memids_);
-        
+        copyOnWrite();
+        instance.addAllMemids(values);
         return this;
       }
       /**
-       * <code>repeated sint64 memids = 9 [packed = true];</code>
-       *
        * <pre>
        * DELTA encoded
        * </pre>
+       *
+       * <code>repeated sint64 memids = 9 [packed = true];</code>
        */
       public Builder clearMemids() {
-        memids_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000020);
-        
+        copyOnWrite();
+        instance.clearMemids();
         return this;
       }
 
-      private java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType> types_ =
-        java.util.Collections.emptyList();
-      private void ensureTypesIsMutable() {
-        if (!((bitField0_ & 0x00000040) == 0x00000040)) {
-          types_ = new java.util.ArrayList<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType>(types_);
-          bitField0_ |= 0x00000040;
-        }
-      }
       /**
        * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
        */
       public java.util.List<org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType> getTypesList() {
-        return java.util.Collections.unmodifiableList(types_);
+        return instance.getTypesList();
       }
       /**
        * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
        */
       public int getTypesCount() {
-        return types_.size();
+        return instance.getTypesCount();
       }
       /**
        * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
        */
       public org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType getTypes(int index) {
-        return types_.get(index);
+        return instance.getTypes(index);
       }
       /**
        * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
        */
       public Builder setTypes(
           int index, org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureTypesIsMutable();
-        types_.set(index, value);
-        
+        copyOnWrite();
+        instance.setTypes(index, value);
         return this;
       }
       /**
        * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
        */
       public Builder addTypes(org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        ensureTypesIsMutable();
-        types_.add(value);
-        
+        copyOnWrite();
+        instance.addTypes(value);
         return this;
       }
       /**
@@ -12924,31 +12808,271 @@ public final class Osmformat {
        */
       public Builder addAllTypes(
           java.lang.Iterable<? extends org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType> values) {
-        ensureTypesIsMutable();
-        com.google.protobuf.AbstractMessageLite.Builder.addAll(
-            values, types_);
-        
-        return this;
+        copyOnWrite();
+        instance.addAllTypes(values);  return this;
       }
       /**
        * <code>repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];</code>
        */
       public Builder clearTypes() {
-        types_ = java.util.Collections.emptyList();
-        bitField0_ = (bitField0_ & ~0x00000040);
-        
+        copyOnWrite();
+        instance.clearTypes();
         return this;
       }
 
       // @@protoc_insertion_point(builder_scope:OSMPBF.Relation)
     }
+    private byte memoizedIsInitialized = -1;
+    protected final Object dynamicMethod(
+        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
+        Object arg0, Object arg1) {
+      switch (method) {
+        case NEW_MUTABLE_INSTANCE: {
+          return new org.openstreetmap.osmosis.osmbinary.Osmformat.Relation();
+        }
+        case IS_INITIALIZED: {
+          byte isInitialized = memoizedIsInitialized;
+          if (isInitialized == 1) return DEFAULT_INSTANCE;
+          if (isInitialized == 0) return null;
+
+          boolean shouldMemoize = ((Boolean) arg0).booleanValue();
+          if (!hasId()) {
+            if (shouldMemoize) {
+              memoizedIsInitialized = 0;
+            }
+            return null;
+          }
+          if (shouldMemoize) memoizedIsInitialized = 1;
+          return DEFAULT_INSTANCE;
+
+        }
+        case MAKE_IMMUTABLE: {
+          keys_.makeImmutable();
+          vals_.makeImmutable();
+          rolesSid_.makeImmutable();
+          memids_.makeImmutable();
+          types_.makeImmutable();
+          return null;
+        }
+        case NEW_BUILDER: {
+          return new Builder();
+        }
+        case VISIT: {
+          Visitor visitor = (Visitor) arg0;
+          org.openstreetmap.osmosis.osmbinary.Osmformat.Relation other = (org.openstreetmap.osmosis.osmbinary.Osmformat.Relation) arg1;
+          id_ = visitor.visitLong(
+              hasId(), id_,
+              other.hasId(), other.id_);
+          keys_= visitor.visitIntList(keys_, other.keys_);
+          vals_= visitor.visitIntList(vals_, other.vals_);
+          info_ = visitor.visitMessage(info_, other.info_);
+          rolesSid_= visitor.visitIntList(rolesSid_, other.rolesSid_);
+          memids_= visitor.visitLongList(memids_, other.memids_);
+          types_= visitor.visitIntList(types_, other.types_);
+          if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
+              .INSTANCE) {
+            bitField0_ |= other.bitField0_;
+          }
+          return this;
+        }
+        case MERGE_FROM_STREAM: {
+          com.google.protobuf.CodedInputStream input =
+              (com.google.protobuf.CodedInputStream) arg0;
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry =
+              (com.google.protobuf.ExtensionRegistryLite) arg1;
+          try {
+            boolean done = false;
+            while (!done) {
+              int tag = input.readTag();
+              switch (tag) {
+                case 0:
+                  done = true;
+                  break;
+                default: {
+                  if (!parseUnknownField(tag, input)) {
+                    done = true;
+                  }
+                  break;
+                }
+                case 8: {
+                  bitField0_ |= 0x00000001;
+                  id_ = input.readInt64();
+                  break;
+                }
+                case 16: {
+                  if (!keys_.isModifiable()) {
+                    keys_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+                  }
+                  keys_.addInt(input.readUInt32());
+                  break;
+                }
+                case 18: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!keys_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    keys_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(keys_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    keys_.addInt(input.readUInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 24: {
+                  if (!vals_.isModifiable()) {
+                    vals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+                  }
+                  vals_.addInt(input.readUInt32());
+                  break;
+                }
+                case 26: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!vals_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    vals_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(vals_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    vals_.addInt(input.readUInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 34: {
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.Info.Builder subBuilder = null;
+                  if (((bitField0_ & 0x00000002) == 0x00000002)) {
+                    subBuilder = info_.toBuilder();
+                  }
+                  info_ = input.readMessage(org.openstreetmap.osmosis.osmbinary.Osmformat.Info.parser(), extensionRegistry);
+                  if (subBuilder != null) {
+                    subBuilder.mergeFrom(info_);
+                    info_ = subBuilder.buildPartial();
+                  }
+                  bitField0_ |= 0x00000002;
+                  break;
+                }
+                case 64: {
+                  if (!rolesSid_.isModifiable()) {
+                    rolesSid_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(rolesSid_);
+                  }
+                  rolesSid_.addInt(input.readInt32());
+                  break;
+                }
+                case 66: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!rolesSid_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    rolesSid_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(rolesSid_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    rolesSid_.addInt(input.readInt32());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 72: {
+                  if (!memids_.isModifiable()) {
+                    memids_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(memids_);
+                  }
+                  memids_.addLong(input.readSInt64());
+                  break;
+                }
+                case 74: {
+                  int length = input.readRawVarint32();
+                  int limit = input.pushLimit(length);
+                  if (!memids_.isModifiable() && input.getBytesUntilLimit() > 0) {
+                    memids_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(memids_);
+                  }
+                  while (input.getBytesUntilLimit() > 0) {
+                    memids_.addLong(input.readSInt64());
+                  }
+                  input.popLimit(limit);
+                  break;
+                }
+                case 80: {
+                  if (!types_.isModifiable()) {
+                    types_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(types_);
+                  }
+                  int rawValue = input.readEnum();
+                  org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value = org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType.forNumber(rawValue);
+                  if (value == null) {
+                    super.mergeVarintField(10, rawValue);
+                  } else {
+                    types_.addInt(rawValue);
+                  }
+                  break;
+                }
+                case 82: {
+                  if (!types_.isModifiable()) {
+                    types_ =
+                        com.google.protobuf.GeneratedMessageLite.mutableCopy(types_);
+                  }
+                  int length = input.readRawVarint32();
+                  int oldLimit = input.pushLimit(length);
+                  while(input.getBytesUntilLimit() > 0) {
+                    int rawValue = input.readEnum();
+                    org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType value = org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.MemberType.forNumber(rawValue);
+                    if (value == null) {
+                      super.mergeVarintField(10, rawValue);
+                    } else {
+                      types_.addInt(rawValue);
+                    }
+                  }
+                  input.popLimit(oldLimit);
+                  break;
+                }
+              }
+            }
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw new RuntimeException(e.setUnfinishedMessage(this));
+          } catch (java.io.IOException e) {
+            throw new RuntimeException(
+                new com.google.protobuf.InvalidProtocolBufferException(
+                    e.getMessage()).setUnfinishedMessage(this));
+          } finally {
+          }
+        }
+        case GET_DEFAULT_INSTANCE: {
+          return DEFAULT_INSTANCE;
+        }
+        case GET_PARSER: {
+          if (PARSER == null) {    synchronized (org.openstreetmap.osmosis.osmbinary.Osmformat.Relation.class) {
+              if (PARSER == null) {
+                PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
+              }
+            }
+          }
+          return PARSER;
+        }
+      }
+      throw new UnsupportedOperationException();
+    }
+
 
+    // @@protoc_insertion_point(class_scope:OSMPBF.Relation)
+    private static final org.openstreetmap.osmosis.osmbinary.Osmformat.Relation DEFAULT_INSTANCE;
     static {
-      defaultInstance = new Relation(true);
-      defaultInstance.initFields();
+      DEFAULT_INSTANCE = new Relation();
+      DEFAULT_INSTANCE.makeImmutable();
     }
 
-    // @@protoc_insertion_point(class_scope:OSMPBF.Relation)
+    public static org.openstreetmap.osmosis.osmbinary.Osmformat.Relation getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static volatile com.google.protobuf.Parser<Relation> PARSER;
+
+    public static com.google.protobuf.Parser<Relation> parser() {
+      return DEFAULT_INSTANCE.getParserForType();
+    }
   }
 
 
diff --git a/osmosis-osm-binary/src/main/java/org/openstreetmap/osmosis/osmbinary/test/BuildTestFile.java b/osmosis-osm-binary/src/main/java/org/openstreetmap/osmosis/osmbinary/test/BuildTestFile.java
index 3f0764b..0557a8e 100644
--- a/osmosis-osm-binary/src/main/java/org/openstreetmap/osmosis/osmbinary/test/BuildTestFile.java
+++ b/osmosis-osm-binary/src/main/java/org/openstreetmap/osmosis/osmbinary/test/BuildTestFile.java
@@ -145,7 +145,7 @@ public class BuildTestFile {
   }
   
   
-  public static void main(String [] args) {
+  public static void main(String[] args) {
     try {
       BuildTestFile out1a = new BuildTestFile("TestFile1-deflate.osm.pbf","deflate");
       out1a.makeSimpleFileBlock1();
diff --git a/osmosis-osm-binary/src/main/protobuf/fileformat.proto b/osmosis-osm-binary/src/main/protobuf/fileformat.proto
index dfc1c3b..e0ae6e5 100644
--- a/osmosis-osm-binary/src/main/protobuf/fileformat.proto
+++ b/osmosis-osm-binary/src/main/protobuf/fileformat.proto
@@ -15,6 +15,8 @@
 
 */
 
+syntax = "proto2";
+
 option optimize_for = LITE_RUNTIME;
 option java_package = "org.openstreetmap.osmosis.osmbinary";
 package OSMPBF;
diff --git a/osmosis-osm-binary/src/main/protobuf/osmformat.proto b/osmosis-osm-binary/src/main/protobuf/osmformat.proto
index 659b8c8..fccc35b 100644
--- a/osmosis-osm-binary/src/main/protobuf/osmformat.proto
+++ b/osmosis-osm-binary/src/main/protobuf/osmformat.proto
@@ -15,6 +15,8 @@
 
 */
 
+syntax = "proto2";
+
 option optimize_for = LITE_RUNTIME;
 option java_package = "org.openstreetmap.osmosis.osmbinary";
 package OSMPBF;
diff --git a/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisReader.java b/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisReader.java
index 49b4a8d..55df91e 100644
--- a/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisReader.java
+++ b/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisReader.java
@@ -47,7 +47,7 @@ public class OsmosisReader implements RunnableSource {
         } catch (IOException e) {
             throw new OsmosisRuntimeException("Unable to process PBF stream", e);
         } finally {
-        	sink.release();
+        	sink.close();
         }
     }
     /** Store the input stream we're using. */
diff --git a/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisSerializer.java b/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisSerializer.java
index 71e9617..785378f 100644
--- a/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisSerializer.java
+++ b/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisSerializer.java
@@ -500,9 +500,9 @@ public class OsmosisSerializer extends BinarySerializer implements Sink {
     }
 
     @Override
-    public void release() {
+    public void close() {
         try {
-            close();
+            super.close();
         } catch (IOException e) {
         	LOG.log(Level.WARNING, "Unable to release PBF file resources during release.", e);
         }
diff --git a/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/PbfReader.java b/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/PbfReader.java
index f3e62b8..3591561 100644
--- a/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/PbfReader.java
+++ b/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/PbfReader.java
@@ -9,6 +9,7 @@ import java.io.InputStream;
 import java.util.Collections;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.function.Supplier;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.task.v0_6.RunnableSource;
@@ -16,7 +17,6 @@ import org.openstreetmap.osmosis.core.task.v0_6.Sink;
 import org.openstreetmap.osmosis.pbf2.v0_6.impl.PbfDecoder;
 import org.openstreetmap.osmosis.pbf2.v0_6.impl.PbfStreamSplitter;
 
-
 /**
  * An OSM data source reading from a PBF file. The entire contents of the file
  * are read.
@@ -24,12 +24,10 @@ import org.openstreetmap.osmosis.pbf2.v0_6.impl.PbfStreamSplitter;
  * @author Brett Henderson
  */
 public class PbfReader implements RunnableSource {
-
-	private File file;
+	private final Supplier<InputStream> supplier;
 	private Sink sink;
 	private int workers;
 
-
 	/**
 	 * Creates a new instance.
 	 * 
@@ -38,34 +36,50 @@ public class PbfReader implements RunnableSource {
 	 * @param workers
 	 *            The number of worker threads for decoding PBF blocks.
 	 */
-	public PbfReader(File file, int workers) {
-		this.file = file;
-		this.workers = workers;
+	public PbfReader(final File file, int workers) {
+		this(new Supplier<InputStream>() {
+			@Override
+			public InputStream get() {
+				// make "-" an alias for /dev/stdin
+				if (file.getName().equals("-")) {
+					return System.in;
+				}
+				try {
+					return new FileInputStream(file);
+				} catch (IOException e) {
+					throw new OsmosisRuntimeException("Unable to read PBF file " + file + ".", e);
+				}
+			}
+		}, workers);
 	}
 
+	/**
+	 * Creates a new instance.
+	 * 
+	 * @param supplier
+	 *            The inputstream to read.
+	 * @param workers
+	 *            The number of worker threads for decoding PBF blocks.
+	 */
+	public PbfReader(Supplier<InputStream> supplier, int workers) {
+		this.supplier = supplier;
+		this.workers = workers;
+	}
 
 	@Override
 	public void setSink(Sink sink) {
 		this.sink = sink;
 	}
 
-
 	@Override
 	public void run() {
 		PbfStreamSplitter streamSplitter = null;
 		ExecutorService executorService = Executors.newFixedThreadPool(workers);
 
 		try {
-			InputStream inputStream;
-
 			sink.initialize(Collections.<String, Object>emptyMap());
 
-			// make "-" an alias for /dev/stdin
-			if (file.getName().equals("-")) {
-				inputStream = System.in;
-			} else {
-				inputStream = new FileInputStream(file);
-			}
+			InputStream inputStream = supplier.get();
 
 			// Create a stream splitter to break the PBF stream into blobs.
 			streamSplitter = new PbfStreamSplitter(new DataInputStream(inputStream));
@@ -80,17 +94,15 @@ public class PbfReader implements RunnableSource {
 			pbfDecoder.run();
 
 			sink.complete();
-
-		} catch (IOException e) {
-			throw new OsmosisRuntimeException("Unable to read PBF file " + file + ".", e);
 		} finally {
-			sink.release();
+			sink.close();
 
 			executorService.shutdownNow();
 
 			if (streamSplitter != null) {
-				streamSplitter.release();
+				streamSplitter.close();
 			}
 		}
 	}
+
 }
diff --git a/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/impl/PbfStreamSplitter.java b/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/impl/PbfStreamSplitter.java
index 67a14ee..4140352 100644
--- a/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/impl/PbfStreamSplitter.java
+++ b/osmosis-pbf2/src/main/java/org/openstreetmap/osmosis/pbf2/v0_6/impl/PbfStreamSplitter.java
@@ -9,7 +9,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.osmbinary.Fileformat;
 import org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader;
 
@@ -20,7 +20,7 @@ import org.openstreetmap.osmosis.osmbinary.Fileformat.BlobHeader;
  * 
  * @author Brett Henderson
  */
-public class PbfStreamSplitter implements Iterator<PbfRawBlob>, Releasable {
+public class PbfStreamSplitter implements Iterator<PbfRawBlob>, Closeable {
 
 	private static Logger log = Logger.getLogger(PbfStreamSplitter.class.getName());
 
@@ -119,7 +119,7 @@ public class PbfStreamSplitter implements Iterator<PbfRawBlob>, Releasable {
 
 
 	@Override
-	public void release() {
+	public void close() {
 		if (dis != null) {
 			try {
 				dis.close();
diff --git a/osmosis-pgsimple/build.gradle b/osmosis-pgsimple/build.gradle
index 248ac5f..617c41f 100644
--- a/osmosis-pgsimple/build.gradle
+++ b/osmosis-pgsimple/build.gradle
@@ -11,6 +11,3 @@ dependencies {
     testCompile project(':osmosis-testutil')
     testCompile project(':osmosis-xml')
 }
-
-// Disable tests until continuous integration has a database configured.
-test.enabled = false
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseDao.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseDao.java
index 98376b9..b363dc0 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseDao.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseDao.java
@@ -4,7 +4,7 @@ package org.openstreetmap.osmosis.pgsimple.common;
 import java.sql.PreparedStatement;
 
 import org.openstreetmap.osmosis.core.database.ReleasableStatementContainer;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -12,7 +12,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public class BaseDao implements Releasable {
+public class BaseDao implements Closeable {
 	
 	private DatabaseContext dbCtx;
 	private ReleasableStatementContainer statementContainer;
@@ -59,7 +59,7 @@ public class BaseDao implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		statementContainer.release();
+	public void close() {
+		statementContainer.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseTableReader.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseTableReader.java
index d53f897..a172062 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseTableReader.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/BaseTableReader.java
@@ -136,7 +136,7 @@ public abstract class BaseTableReader<T> implements ReleasableIterator<T> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (resultSet != null) {
 			try {
 				resultSet.close();
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CompactPersistentNodeLocationStore.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CompactPersistentNodeLocationStore.java
index 1e08fd8..277e9b7 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CompactPersistentNodeLocationStore.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CompactPersistentNodeLocationStore.java
@@ -63,11 +63,11 @@ public class CompactPersistentNodeLocationStore implements NodeLocationStore {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		if (nodeLocationsReader != null) {
-			nodeLocationsReader.release();
+			nodeLocationsReader.close();
 		}
 		
-		nodeLocations.release();
+		nodeLocations.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CopyFileWriter.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CopyFileWriter.java
index 60cfab0..fed4a66 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CopyFileWriter.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/CopyFileWriter.java
@@ -6,18 +6,16 @@ import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.postgis.Geometry;
-import org.postgis.binary.BinaryWriter;
-
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.lifecycle.Completable;
+import org.postgis.Geometry;
+import org.postgis.binary.BinaryWriter;
 
 
 /**
@@ -275,27 +273,12 @@ public class CopyFileWriter implements Completable {
 	 */
 	private void initialize() {
 		if (!initialized) {
-			OutputStream outStream = null;
-			
 			try {
-				outStream = new FileOutputStream(file);
-				
 				writer = new BufferedWriter(
-						new OutputStreamWriter(new BufferedOutputStream(outStream, 65536), "UTF-8"));
-				
-				outStream = null;
+						new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file), 65536), "UTF-8"));
 				
 			} catch (IOException e) {
 				throw new OsmosisRuntimeException("Unable to open file for writing.", e);
-			} finally {
-				if (outStream != null) {
-					try {
-						outStream.close();
-					} catch (Exception e) {
-						log.log(Level.SEVERE, "Unable to close output stream.", e);
-					}
-					outStream = null;
-				}
 			}
 			
 			initialized = true;
@@ -330,7 +313,7 @@ public class CopyFileWriter implements Completable {
 	/**
 	 * Cleans up any open file handles.
 	 */
-	public void release() {
+	public void close() {
 		try {
 			try {
 				if (writer != null) {
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/DatabaseContext.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/DatabaseContext.java
index 13fd3c1..9c137af 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/DatabaseContext.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/DatabaseContext.java
@@ -25,7 +25,7 @@ import org.openstreetmap.osmosis.core.database.DatabaseLoginCredentials;
  * 
  * @author Brett Henderson
  */
-public class DatabaseContext {
+public class DatabaseContext implements AutoCloseable {
 	private static final Logger LOG = Logger.getLogger(DatabaseContext.class.getName());
 	
 	
@@ -270,33 +270,15 @@ public class DatabaseContext {
 	 * @return True if the column exists, false otherwise.
 	 */
 	public boolean doesColumnExist(String tableName, String columnName) {
-		ResultSet resultSet = null;
-		boolean result;
-		
-		try {
-			LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
-			
-			resultSet = getConnection().getMetaData().getColumns(null, null, tableName, columnName);
-			result = resultSet.next();
-			resultSet.close();
-			resultSet = null;
+		LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
+		try (ResultSet resultSet = getConnection().getMetaData().getColumns(null, null, tableName, columnName)) {
 			
-			return result;
+			return resultSet.next();
 			
 		} catch (SQLException e) {
 			throw new OsmosisRuntimeException(
-				"Unable to check for the existence of column " + tableName + "." + columnName + ".",
-				e
+				"Unable to check for the existence of column " + tableName + "." + columnName + ".", e
 			);
-		} finally {
-			if (resultSet != null) {
-				try {
-					resultSet.close();
-				} catch (SQLException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close column existence result set.", e);
-				}
-			}
 		}
 	}
 	
@@ -308,33 +290,17 @@ public class DatabaseContext {
 	 * @return True if the table exists, false otherwise.
 	 */
 	public boolean doesTableExist(String tableName) {
-		ResultSet resultSet = null;
-		boolean result;
-		
-		try {
-			LOG.finest("Checking if table {" + tableName + "} exists.");
+		LOG.finest("Checking if table {" + tableName + "} exists.");
+		try (ResultSet resultSet =
+					 getConnection().getMetaData().getTables(null, null, tableName, new String[]{"TABLE"})) {
 			
-			resultSet = getConnection().getMetaData().getTables(null, null, tableName, new String[]{"TABLE"});
-			result = resultSet.next();
-			resultSet.close();
-			resultSet = null;
-			
-			return result;
+			return resultSet.next();
 			
 		} catch (SQLException e) {
 			throw new OsmosisRuntimeException(
 				"Unable to check for the existence of table " + tableName + ".",
 				e
 			);
-		} finally {
-			if (resultSet != null) {
-				try {
-					resultSet.close();
-				} catch (SQLException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close table existence result set.", e);
-				}
-			}
 		}
 	}
 
@@ -377,11 +343,11 @@ public class DatabaseContext {
 	
 	
 	/**
-	 * Releases all database resources. This method is guaranteed not to throw
-	 * transactions and should always be called in a finally block whenever this
+	 * Releases all database resources. This method is guaranteed not to throw transactions
+	 * and should always be called in a finally or try-with-resources block whenever this
 	 * class is used.
 	 */
-	public void release() {
+	public void close() {
 		if (connection != null) {
 			try {
 				LOG.finest("Closing the database connection.");
@@ -408,7 +374,7 @@ public class DatabaseContext {
 	 */
 	@Override
 	protected void finalize() throws Throwable {
-		release();
+		close();
 		
 		super.finalize();
 	}
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/InMemoryNodeLocationStore.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/InMemoryNodeLocationStore.java
index 5807b71..0bd5985 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/InMemoryNodeLocationStore.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/InMemoryNodeLocationStore.java
@@ -197,7 +197,7 @@ public class InMemoryNodeLocationStore implements NodeLocationStore {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		logMemoryConsumption(Level.FINE);
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/NodeLocationStore.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/NodeLocationStore.java
index 54c05c0..0c531c7 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/NodeLocationStore.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/NodeLocationStore.java
@@ -1,7 +1,7 @@
 // This software is released into the Public Domain.  See copying.txt for details.
 package org.openstreetmap.osmosis.pgsimple.common;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -10,7 +10,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public interface NodeLocationStore extends Releasable {
+public interface NodeLocationStore extends Closeable {
 	/**
 	 * Adds the specified node location details.
 	 * 
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/PersistentNodeLocationStore.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/PersistentNodeLocationStore.java
index e37e0ca..eefbe42 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/PersistentNodeLocationStore.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/common/PersistentNodeLocationStore.java
@@ -217,7 +217,7 @@ public class PersistentNodeLocationStore implements NodeLocationStore {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		if (fileOutStream != null) {
 			try {
 				fileOutStream.close();
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlChangeWriter.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlChangeWriter.java
index 47c61a0..04b8760 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlChangeWriter.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlChangeWriter.java
@@ -93,9 +93,9 @@ public class PostgreSqlChangeWriter implements ChangeSink {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		changeWriter.release();
 		
-		dbCtx.release();
+		dbCtx.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlCopyWriter.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlCopyWriter.java
index 48d2649..0c7ac89 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlCopyWriter.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlCopyWriter.java
@@ -60,15 +60,10 @@ public class PostgreSqlCopyWriter implements Sink {
 	
 	private void initialize() {
 		if (!initialized) {
-			DatabaseContext dbCtx;
-			DatabaseCapabilityChecker capabilityChecker;
-			
 			LOG.fine("Initializing the database and temporary processing files.");
 			
-			dbCtx = new DatabaseContext(loginCredentials);
-			
-			try {
-				capabilityChecker = new DatabaseCapabilityChecker(dbCtx);
+			try (DatabaseContext dbCtx = new DatabaseContext(loginCredentials)) {
+				DatabaseCapabilityChecker capabilityChecker = new DatabaseCapabilityChecker(dbCtx);
 
 				populateBbox = capabilityChecker.isWayBboxSupported();
 				populateLinestring = capabilityChecker.isWayLinestringSupported();				
@@ -79,9 +74,6 @@ public class PostgreSqlCopyWriter implements Sink {
 				copyFilesetLoader = new CopyFilesetLoader(loginCredentials, preferences, copyFileset);
 				
 				LOG.fine("Processing input data, building geometries and creating database load files.");
-				
-			} finally {
-				dbCtx.release();
 			}
 			
 			initialized = true;
@@ -124,9 +116,9 @@ public class PostgreSqlCopyWriter implements Sink {
 	/**
 	 * Releases all database resources.
 	 */
-	public void release() {
-		copyFilesetBuilder.release();
-		copyFileset.release();
+	public void close() {
+		copyFilesetBuilder.close();
+		copyFileset.close();
 		
 		initialized = false;
 	}
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDatasetReader.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDatasetReader.java
index 2dd5fd4..fd66b4d 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDatasetReader.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDatasetReader.java
@@ -53,7 +53,7 @@ public class PostgreSqlDatasetReader implements RunnableDatasetSource, Dataset {
 			datasetSink.process(this);
 			
 		} finally {
-			datasetSink.release();
+			datasetSink.close();
 		}
 	}
 	
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDumpWriter.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDumpWriter.java
index 2b1bd61..79b1b41 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDumpWriter.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlDumpWriter.java
@@ -79,7 +79,7 @@ public class PostgreSqlDumpWriter implements Sink {
 	/**
 	 * Releases all database resources.
 	 */
-	public void release() {
-		copyFilesetBuilder.release();
+	public void close() {
+		copyFilesetBuilder.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTruncator.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTruncator.java
index 84bd382..f369fa8 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTruncator.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTruncator.java
@@ -76,7 +76,7 @@ public class PostgreSqlTruncator implements RunnableTask {
 			LOG.fine("Complete.");
 			
 		} finally {
-			dbCtx.release();
+			dbCtx.close();
 		}
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlWriter.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlWriter.java
index fa5a082..5796a5b 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlWriter.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlWriter.java
@@ -829,10 +829,10 @@ public class PostgreSqlWriter implements Sink, EntityProcessor {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		statementContainer.release();
-		wayGeometryBuilder.release();
+	public void close() {
+		statementContainer.close();
+		wayGeometryBuilder.close();
 		
-		dbCtx.release();
+		dbCtx.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ActionDataType.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ActionDataType.java
index 4af54cc..4a8690c 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ActionDataType.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ActionDataType.java
@@ -27,9 +27,14 @@ public enum ActionDataType {
 	
 	
 	private final String dbValue;
-	
-	
-	private ActionDataType(String dbValue) {
+
+
+	/**
+	 * Create a new instance.
+	 *
+	 * @param dbValue See {@link ActionDataType#getDatabaseValue()}
+	 */
+	ActionDataType(String dbValue) {
 		this.dbValue = dbValue;
 	}
 	
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangeWriter.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangeWriter.java
index 6223025..d73c86d 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangeWriter.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangeWriter.java
@@ -196,18 +196,14 @@ public class ChangeWriter {
 	 * Performs post-change database updates.
 	 */
 	public void complete() {
-		ReleasableStatementContainer statementContainer;
 		CallableStatement updateStatement;
 		
-		statementContainer = new ReleasableStatementContainer();
-		try {
+		try (ReleasableStatementContainer statementContainer = new ReleasableStatementContainer()) {
 			updateStatement = statementContainer.add(dbCtx.prepareCall("{call osmosisUpdate()}"));
 			updateStatement.executeUpdate();
 			
 		} catch (SQLException e) {
 			throw new OsmosisRuntimeException("Unable to invoke the osmosis update stored function.", e);
-		} finally {
-			statementContainer.release();
 		}
 		
 		// Clear all action records.
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangesetAction.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangesetAction.java
index c142b4e..1352e34 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangesetAction.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/ChangesetAction.java
@@ -29,9 +29,14 @@ public enum ChangesetAction {
 	
 	
 	private final String dbValue;
-	
-	
-	private ChangesetAction(String dbValue) {
+
+
+	/**
+	 * Create a new instance.
+	 *
+	 * @param dbValue See {@link ChangesetAction#getDatabaseValue()}
+	 */
+	ChangesetAction(String dbValue) {
 		this.dbValue = dbValue;
 	}
 	
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetBuilder.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetBuilder.java
index b099559..6fbdea9 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetBuilder.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetBuilder.java
@@ -252,8 +252,8 @@ public class CopyFilesetBuilder implements Sink, EntityProcessor {
 	/**
 	 * Releases all resources.
 	 */
-	public void release() {
-		writerContainer.release();
-		wayGeometryBuilder.release();
+	public void close() {
+		writerContainer.close();
+		wayGeometryBuilder.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetLoader.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetLoader.java
index a48e466..f5fcb1f 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetLoader.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/CopyFilesetLoader.java
@@ -7,7 +7,6 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.sql.SQLException;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
@@ -64,35 +63,15 @@ public class CopyFilesetLoader implements Runnable {
 	 *            The table to load the data into.
 	 */
     public void loadCopyFile(DatabaseContext dbCtx, File copyFile, String tableName) {
-    	CopyManager copyManager;
-    	InputStream inStream = null;
-    	
-    	try {
-    		InputStream bufferedInStream;
-    		
-    		inStream = new FileInputStream(copyFile);
-    		bufferedInStream = new BufferedInputStream(inStream, 65536);
-    		
-    		copyManager = new CopyManager((BaseConnection) dbCtx.getConnection());
+    	try (InputStream bufferedInStream = new BufferedInputStream(new FileInputStream(copyFile), 65536)) {
+    		CopyManager copyManager = new CopyManager((BaseConnection) dbCtx.getConnection());
     		
     		copyManager.copyIn("COPY " + tableName + " FROM STDIN", bufferedInStream);
 			
-    		inStream.close();
-			inStream = null;
-			
     	} catch (IOException e) {
     		throw new OsmosisRuntimeException("Unable to process COPY file " + copyFile + ".", e);
     	} catch (SQLException e) {
     		throw new OsmosisRuntimeException("Unable to process COPY file " + copyFile + ".", e);
-    	} finally {
-    		if (inStream != null) {
-				try {
-					inStream.close();
-				} catch (Exception e) {
-					LOG.log(Level.SEVERE, "Unable to close COPY file.", e);
-				}
-				inStream = null;
-			}
     	}
     }
     
@@ -101,9 +80,7 @@ public class CopyFilesetLoader implements Runnable {
      * Reads all data from the database and send it to the sink.
      */
     public void run() {
-    	DatabaseContext dbCtx = new DatabaseContext(loginCredentials);
-    	
-    	try {
+    	try (DatabaseContext dbCtx = new DatabaseContext(loginCredentials)) {
 			IndexManager indexManager;
 			
 			new SchemaVersionValidator(dbCtx, preferences)
@@ -147,9 +124,6 @@ public class CopyFilesetLoader implements Runnable {
     		dbCtx.executeStatement("VACUUM ANALYZE");
     		
     		LOG.fine("Complete.");
-    		
-    	} finally {
-    		dbCtx.release();
     	}
     }
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityDao.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityDao.java
index d459f4d..11e59c3 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityDao.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityDao.java
@@ -6,8 +6,6 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.DbFeature;
@@ -27,8 +25,7 @@ import org.openstreetmap.osmosis.pgsimple.common.NoSuchRecordException;
  *            The entity type to be supported.
  */
 public abstract class EntityDao<T extends Entity> extends BaseDao {
-	private static final Logger LOG = Logger.getLogger(EntityDao.class.getName());
-	
+
 	private EntityFeatureDao<Tag, DbFeature<Tag>> tagDao;
 	private ActionDao actionDao;
 	private EntityMapper<T> entityMapper;
@@ -67,45 +64,31 @@ public abstract class EntityDao<T extends Entity> extends BaseDao {
 	 * @return True if the entity exists in the database.
 	 */
 	public boolean exists(long entityId) {
-		ResultSet resultSet = null;
-		
 		if (countStatement == null) {
 			countStatement = prepareStatement(entityMapper.getSqlSelectCount(true));
 		}
 		
 		try {
-			boolean result;
-			
 			countStatement.setLong(1, entityId);
-			
-			resultSet = countStatement.executeQuery();
-			
-			if (!resultSet.next()) {
-				throw new OsmosisRuntimeException(
-						"Entity count query didn't return any rows.");
+
+			try (ResultSet resultSet = countStatement.executeQuery()) {
+				boolean result;
+				
+				if (!resultSet.next()) {
+					throw new OsmosisRuntimeException(
+							"Entity count query didn't return any rows.");
+				}
+				result = resultSet.getLong("count") > 0;
+				
+				return result;
 			}
-			result = resultSet.getLong("count") > 0;
-			
-			resultSet.close();
-			resultSet = null;
-			
-			return result;
-			
+
 		} catch (SQLException e) {
 			throw new OsmosisRuntimeException(
 				"Count query failed for "
 					+ entityMapper.getEntityName() + " " + entityId + ".",
 				e
 			);
-		} finally {
-			if (resultSet != null) {
-				try {
-					resultSet.close();
-				} catch (SQLException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close result set.", e);
-				}
-			}
 		}
 	}
 	
@@ -118,7 +101,6 @@ public abstract class EntityDao<T extends Entity> extends BaseDao {
 	 * @return The loaded entity.
 	 */
 	public T getEntity(long entityId) {
-		ResultSet resultSet = null;
 		T entity;
 		
 		if (getStatement == null) {
@@ -127,17 +109,14 @@ public abstract class EntityDao<T extends Entity> extends BaseDao {
 		
 		try {
 			getStatement.setLong(1, entityId);
-			
-			resultSet = getStatement.executeQuery();
-			
-			if (!resultSet.next()) {
-				throw new NoSuchRecordException(entityMapper.getEntityName()
-						+ " " + entityId + " doesn't exist.");
+	
+			try (ResultSet resultSet = getStatement.executeQuery()) {			
+				if (!resultSet.next()) {
+					throw new NoSuchRecordException(entityMapper.getEntityName()
+							+ " " + entityId + " doesn't exist.");
+				}
+				entity = entityMapper.parseRecord(resultSet);
 			}
-			entity = entityMapper.parseRecord(resultSet);
-			
-			resultSet.close();
-			resultSet = null;
 			
 			for (DbFeature<Tag> dbTag : tagDao.getAll(entityId)) {
 				entity.getTags().add(dbTag.getFeature());
@@ -154,15 +133,6 @@ public abstract class EntityDao<T extends Entity> extends BaseDao {
 					+ entityMapper.getEntityName() + " " + entityId + ".",
 				e
 			);
-		} finally {
-			if (resultSet != null) {
-				try {
-					resultSet.close();
-				} catch (SQLException e) {
-					// We are already in an error condition so log and continue.
-					LOG.log(Level.WARNING, "Unable to close result set.", e);
-				}
-			}
 		}
 	}
 	
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityReader.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityReader.java
index e11e256..ed98681 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityReader.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/EntityReader.java
@@ -171,8 +171,8 @@ public class EntityReader<T extends Entity> implements ReleasableIterator<T> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		entityReader.release();
-		entityTagReader.release();
+	public void close() {
+		entityReader.close();
+		entityTagReader.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/PostgreSqlDatasetContext.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/PostgreSqlDatasetContext.java
index 4e1fbae..f3354c6 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/PostgreSqlDatasetContext.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/PostgreSqlDatasetContext.java
@@ -455,12 +455,12 @@ public class PostgreSqlDatasetContext implements DatasetContext {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		releasableContainer.release();
+	public void close() {
+		releasableContainer.close();
 		releasableContainer.clear();
 		
 		if (dbCtx != null) {
-			dbCtx.release();
+			dbCtx.close();
 			
 			dbCtx = null;
 		}
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/RelationReader.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/RelationReader.java
index 47da3d1..f749077 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/RelationReader.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/RelationReader.java
@@ -98,9 +98,9 @@ public class RelationReader  extends EntityReader<Relation> {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		super.release();
+	public void close() {
+		super.close();
 		
-		relationMemberReader.release();
+		relationMemberReader.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/TempCopyFileset.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/TempCopyFileset.java
index faea723..61ddd4c 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/TempCopyFileset.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/TempCopyFileset.java
@@ -7,7 +7,7 @@ import java.util.ArrayList;
 import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -16,7 +16,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * @author Brett Henderson
  * 
  */
-public class TempCopyFileset implements CopyFileset, Releasable {
+public class TempCopyFileset implements CopyFileset, Closeable {
 	
 	private static final Logger LOG = Logger.getLogger(TempCopyFileset.class.getName());
 	
@@ -179,7 +179,7 @@ public class TempCopyFileset implements CopyFileset, Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		for (File tmpFile : tmpFiles) {
 			if (!tmpFile.delete()) {
 				// We cannot throw an exception within a release statement.
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayGeometryBuilder.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayGeometryBuilder.java
index f5f9d4b..e5ba254 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayGeometryBuilder.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayGeometryBuilder.java
@@ -8,7 +8,7 @@ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.domain.v0_6.Node;
 import org.openstreetmap.osmosis.core.domain.v0_6.Way;
 import org.openstreetmap.osmosis.core.domain.v0_6.WayNode;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.pgsimple.common.CompactPersistentNodeLocationStore;
 import org.openstreetmap.osmosis.pgsimple.common.InMemoryNodeLocationStore;
 import org.openstreetmap.osmosis.pgsimple.common.NodeLocation;
@@ -27,7 +27,7 @@ import org.postgis.Polygon;
  * 
  * @author Brett Henderson
  */
-public class WayGeometryBuilder implements Releasable {
+public class WayGeometryBuilder implements Closeable {
 	/**
 	 * Stores the locations of nodes so that they can be used to build the way
 	 * geometries.
@@ -223,7 +223,7 @@ public class WayGeometryBuilder implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		locationStore.release();
+	public void close() {
+		locationStore.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayReader.java b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayReader.java
index 3fe8835..04f4e82 100644
--- a/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayReader.java
+++ b/osmosis-pgsimple/src/main/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/WayReader.java
@@ -100,9 +100,9 @@ public class WayReader extends EntityReader<Way> {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		super.release();
+	public void close() {
+		super.close();
 		
-		wayNodeReader.release();
+		wayNodeReader.close();
 	}
 }
diff --git a/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/DatasetDriver.java b/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/DatasetDriver.java
index d19e243..40ce0ee 100644
--- a/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/DatasetDriver.java
+++ b/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/DatasetDriver.java
@@ -44,9 +44,7 @@ public class DatasetDriver implements DatasetSink {
 	 */
 	@Override
 	public void process(Dataset dataset) {
-		DatasetContext dsCtx = dataset.createReader();
-		
-		try {
+		try (DatasetContext dsCtx = dataset.createReader()) {
 			EntityManager<Node> nodeManager = dsCtx.getNodeManager();
 			OsmUser user;
 			Node node;
@@ -71,9 +69,6 @@ public class DatasetDriver implements DatasetSink {
 			nodeManager.addEntity(node);
 			
 			dsCtx.complete();
-			
-		} finally {
-			dsCtx.release();
 		}
 	}
 
@@ -82,7 +77,7 @@ public class DatasetDriver implements DatasetSink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 
diff --git a/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTest.java b/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTest.java
index 887a409..3443f55 100644
--- a/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTest.java
+++ b/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/PostgreSqlTest.java
@@ -41,7 +41,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsimp-0.6",
 				"authFile=" + authFile.getPath()
@@ -50,7 +50,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -61,7 +61,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsimp-0.6",
 				"authFile=" + authFile.getPath(),
@@ -97,7 +97,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsimp-0.6",
 				"authFile=" + authFile.getPath()
@@ -106,7 +106,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -117,7 +117,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsimp-0.6",
 				"authFile=" + authFile.getPath(),
@@ -157,7 +157,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsimp-0.6",
 				"authFile=" + authFile.getPath()
@@ -166,7 +166,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with the snapshot file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				snapshotFile.getPath(),
@@ -177,7 +177,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Apply the changeset file to the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-change-0.6",
 				changesetFile.getPath(),
@@ -188,7 +188,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsimp-0.6",
 				"authFile=" + authFile.getPath(),
@@ -226,7 +226,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsimp-0.6",
 				"authFile=" + authFile.getPath()
@@ -235,7 +235,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with the snapshot file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				snapshotFile.getPath(),
@@ -246,7 +246,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Invoke the dataset driver task task to manipulate the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"-p",
 				DatasetDriverPlugin.class.getName(),
@@ -258,7 +258,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsimp-0.6",
 				"authFile=" + authFile.getPath(),
diff --git a/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/NodeLocationStoreTest.java b/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/NodeLocationStoreTest.java
index 2b27bb0..f9bec40 100644
--- a/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/NodeLocationStoreTest.java
+++ b/osmosis-pgsimple/src/test/java/org/openstreetmap/osmosis/pgsimple/v0_6/impl/NodeLocationStoreTest.java
@@ -56,7 +56,7 @@ public class NodeLocationStoreTest {
 			Assert.assertFalse("The node location should be invalid.", location.isValid());
 		}
 		
-		store.release();
+		store.close();
 	}
 	
 	
diff --git a/osmosis-pgsimple/src/test/resources/data/template/v0_6/pgsql-authfile.txt b/osmosis-pgsimple/src/test/resources/data/template/v0_6/pgsql-authfile.txt
index 4300852..db3d5a3 100644
--- a/osmosis-pgsimple/src/test/resources/data/template/v0_6/pgsql-authfile.txt
+++ b/osmosis-pgsimple/src/test/resources/data/template/v0_6/pgsql-authfile.txt
@@ -1,4 +1,4 @@
-host=localhost
+host=db
 database=pgosmsimp06_test
 user=osm
 password=password
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CompactPersistentNodeLocationStore.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CompactPersistentNodeLocationStore.java
index 8d85336..1b2d0b5 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CompactPersistentNodeLocationStore.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CompactPersistentNodeLocationStore.java
@@ -63,11 +63,11 @@ public class CompactPersistentNodeLocationStore implements NodeLocationStore {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		if (nodeLocationsReader != null) {
-			nodeLocationsReader.release();
+			nodeLocationsReader.close();
 		}
 		
-		nodeLocations.release();
+		nodeLocations.close();
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CopyFileWriter.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CopyFileWriter.java
index b30a171..a547487 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CopyFileWriter.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/CopyFileWriter.java
@@ -6,7 +6,6 @@ import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -14,13 +13,12 @@ import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
+import org.openstreetmap.osmosis.core.lifecycle.Completable;
 import org.postgis.Geometry;
 import org.postgis.binary.BinaryWriter;
 import org.postgresql.util.PGobject;
 
-import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Completable;
-
 
 /**
  * This class provides the capability to write a file that contains data for a
@@ -324,27 +322,12 @@ public class CopyFileWriter implements Completable {
 	 */
 	private void initialize() {
 		if (!initialized) {
-			OutputStream outStream = null;
-			
 			try {
-				outStream = new FileOutputStream(file);
-				
 				writer = new BufferedWriter(
-						new OutputStreamWriter(new BufferedOutputStream(outStream, 65536), "UTF-8"));
-				
-				outStream = null;
+						new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file), 65536), "UTF-8"));
 				
 			} catch (IOException e) {
 				throw new OsmosisRuntimeException("Unable to open file for writing.", e);
-			} finally {
-				if (outStream != null) {
-					try {
-						outStream.close();
-					} catch (Exception e) {
-						log.log(Level.SEVERE, "Unable to close output stream.", e);
-					}
-					outStream = null;
-				}
 			}
 			
 			initialized = true;
@@ -379,7 +362,7 @@ public class CopyFileWriter implements Completable {
 	/**
 	 * Cleans up any open file handles.
 	 */
-	public void release() {
+	public void close() {
 		try {
 			try {
 				if (writer != null) {
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DataSourceManager.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DataSourceManager.java
index e16fa6d..28ec299 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DataSourceManager.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DataSourceManager.java
@@ -14,7 +14,7 @@ import javax.sql.DataSource;
 import org.apache.commons.dbcp.BasicDataSource;
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.database.DatabaseLoginCredentials;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -23,7 +23,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public final class DataSourceManager implements Releasable {
+public final class DataSourceManager implements Closeable {
 	
 	private static final Logger LOG = Logger.getLogger(DataSourceManager.class.getName());
 	
@@ -162,7 +162,7 @@ public final class DataSourceManager implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		if (localDataSource != null) {
 			try {
 				localDataSource.close();
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DatabaseContext.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DatabaseContext.java
index 10b60ac..6cef072 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DatabaseContext.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/DatabaseContext.java
@@ -5,11 +5,9 @@ import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.sql.DataSource;
@@ -34,7 +32,7 @@ import org.springframework.transaction.support.TransactionTemplate;
  * 
  * @author Brett Henderson
  */
-public class DatabaseContext {
+public class DatabaseContext implements AutoCloseable {
 
     private static final Logger LOG = Logger.getLogger(DatabaseContext.class.getName());
 
@@ -132,7 +130,7 @@ public class DatabaseContext {
      * Releases all database resources. This method is guaranteed not to throw transactions and
      * should always be called in a finally block whenever this class is used.
      */
-    public void release() {
+    public void close() {
     	if (transaction != null) {
     		try {
     			txnManager.rollback(transaction);
@@ -141,7 +139,7 @@ public class DatabaseContext {
     		}
     	}
     	
-    	dataSourceManager.release();
+    	dataSourceManager.close();
     }
     
 
@@ -153,39 +151,17 @@ public class DatabaseContext {
      * @return True if the column exists, false otherwise.
      */
     public boolean doesColumnExist(String tableName, String columnName) {
-        ResultSet resultSet = null;
-        boolean result;
+    	LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
+        Connection connection = DataSourceUtils.getConnection(dataSource);
+        try (ResultSet resultSet = connection.getMetaData().getColumns(null, null, tableName, columnName)) {
 
-        try {
-        	Connection connection;
-        	
-            LOG.finest("Checking if column {" + columnName + "} in table {" + tableName + "} exists.");
-
-            // This connection may not be freed if an exception occurs. It's a small chance and the
-			// additional code to avoid it is cumbersome.
-            connection = DataSourceUtils.getConnection(dataSource);
-            
-            resultSet = connection.getMetaData().getColumns(null, null, tableName, columnName);
-            result = resultSet.next();
-            resultSet.close();
-            resultSet = null;
-            
-            DataSourceUtils.releaseConnection(connection, dataSource);
-
-            return result;
+        	return resultSet.next();
 
         } catch (SQLException e) {
             throw new OsmosisRuntimeException("Unable to check for the existence of column " + tableName + "."
                     + columnName + ".", e);
         } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close column existence result set.", e);
-                }
-            }
+        	DataSourceUtils.releaseConnection(connection, dataSource);
         }
     }
 
@@ -196,38 +172,16 @@ public class DatabaseContext {
      * @return True if the table exists, false otherwise.
      */
     public boolean doesTableExist(String tableName) {
-        ResultSet resultSet = null;
-        boolean result;
-
-        try {
-        	Connection connection;
-        	
-            LOG.finest("Checking if table {" + tableName + "} exists.");
-
-            // This connection may not be freed if an exception occurs. It's a small chance and the
-			// additional code to avoid it is cumbersome.
-            connection = DataSourceUtils.getConnection(dataSource);
+    	LOG.finest("Checking if table {" + tableName + "} exists.");
+    	Connection connection = DataSourceUtils.getConnection(dataSource);
+        try (ResultSet resultSet = connection.getMetaData().getTables(null, null, tableName, new String[] {"TABLE"})) {
 
-            resultSet = connection.getMetaData().getTables(null, null, tableName, new String[] {"TABLE"});
-            result = resultSet.next();
-            resultSet.close();
-            resultSet = null;
-            
-            DataSourceUtils.releaseConnection(connection, dataSource);
-
-            return result;
+            return resultSet.next();
 
         } catch (SQLException e) {
             throw new OsmosisRuntimeException("Unable to check for the existence of table " + tableName + ".", e);
         } finally {
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    // We are already in an error condition so log and continue.
-                    LOG.log(Level.WARNING, "Unable to close table existence result set.", e);
-                }
-            }
+        	DataSourceUtils.releaseConnection(connection, dataSource);
         }
     }
 
@@ -244,56 +198,35 @@ public class DatabaseContext {
 	 */
     public void loadCopyFile(File copyFile, String tableName, String ... columns) {
     	CopyManager copyManager;
-    	InputStream inStream = null;
-    	
-    	try {
-    		StringBuilder copyStatement;
-    		InputStream bufferedInStream;
-    		Connection conn;
-    		
-    		copyStatement = new StringBuilder();
-    		copyStatement.append("COPY ");
-    		copyStatement.append(tableName);
-    		if (columns.length > 0) {
-    			copyStatement.append('(');
-    			for (int i = 0; i < columns.length; i++) {
-    				if (i > 0) {
-    					copyStatement.append(',');
-    				}
-    				copyStatement.append(columns[i]);
-    			}
-    			copyStatement.append(')');
-    		}
-    		copyStatement.append(" FROM STDIN");
-    		
-    		inStream = new FileInputStream(copyFile);
-    		bufferedInStream = new BufferedInputStream(inStream, 65536);
-    		
-    		conn = DataSourceUtils.getConnection(dataSource);
+
+		StringBuilder copyStatement = new StringBuilder();
+		copyStatement.append("COPY ");
+		copyStatement.append(tableName);
+		if (columns.length > 0) {
+			copyStatement.append('(');
+			for (int i = 0; i < columns.length; i++) {
+				if (i > 0) {
+					copyStatement.append(',');
+				}
+				copyStatement.append(columns[i]);
+			}
+			copyStatement.append(')');
+		}
+		copyStatement.append(" FROM STDIN");
+		
+		try (BufferedInputStream inStream = new BufferedInputStream(new FileInputStream(copyFile), 65536)) {
+    		Connection conn = DataSourceUtils.getConnection(dataSource);
     		try {
 	    		copyManager = new CopyManager(conn.unwrap(BaseConnection.class));
 	    		
-	    		copyManager.copyIn(copyStatement.toString(), bufferedInStream);
-    		} finally {
+	    		copyManager.copyIn(copyStatement.toString(), inStream);
+    		} catch (SQLException e) {
+        		throw new OsmosisRuntimeException("Unable to process COPY file " + copyFile + ".", e);
+        	} finally {
     			DataSourceUtils.releaseConnection(conn, dataSource);
     		}
-			
-    		inStream.close();
-			inStream = null;
-			
-    	} catch (IOException e) {
+		} catch (IOException e) {
     		throw new OsmosisRuntimeException("Unable to process COPY file " + copyFile + ".", e);
-    	} catch (SQLException e) {
-    		throw new OsmosisRuntimeException("Unable to process COPY file " + copyFile + ".", e);
-    	} finally {
-    		if (inStream != null) {
-				try {
-					inStream.close();
-				} catch (IOException e) {
-					LOG.log(Level.SEVERE, "Unable to close COPY file.", e);
-				}
-				inStream = null;
-			}
     	}
     }
     
@@ -306,7 +239,7 @@ public class DatabaseContext {
      */
     @Override
     protected void finalize() throws Throwable {
-        release();
+        close();
 
         super.finalize();
     }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/InMemoryNodeLocationStore.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/InMemoryNodeLocationStore.java
index 36eb8f2..da1ad60 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/InMemoryNodeLocationStore.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/InMemoryNodeLocationStore.java
@@ -197,7 +197,7 @@ public class InMemoryNodeLocationStore implements NodeLocationStore {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		logMemoryConsumption(Level.FINE);
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/NodeLocationStore.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/NodeLocationStore.java
index 99f0a20..89cdb36 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/NodeLocationStore.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/NodeLocationStore.java
@@ -1,7 +1,7 @@
 // This software is released into the Public Domain.  See copying.txt for details.
 package org.openstreetmap.osmosis.pgsnapshot.common;
 
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -10,7 +10,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public interface NodeLocationStore extends Releasable {
+public interface NodeLocationStore extends Closeable {
 	/**
 	 * Adds the specified node location details.
 	 * 
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/PersistentNodeLocationStore.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/PersistentNodeLocationStore.java
index d98f45a..06ca57c 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/PersistentNodeLocationStore.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/PersistentNodeLocationStore.java
@@ -217,7 +217,7 @@ public class PersistentNodeLocationStore implements NodeLocationStore {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		if (fileOutStream != null) {
 			try {
 				fileOutStream.close();
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlChangeWriter.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlChangeWriter.java
index 7bbfab4..d15cfa4 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlChangeWriter.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlChangeWriter.java
@@ -117,9 +117,9 @@ public class PostgreSqlChangeWriter implements ChangeSink {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		changeWriter.release();
 		
-		dbCtx.release();
+		dbCtx.close();
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlCopyWriter.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlCopyWriter.java
index 11d58db..a1b1469 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlCopyWriter.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlCopyWriter.java
@@ -66,19 +66,13 @@ public class PostgreSqlCopyWriter implements Sink {
 	
 	private void initialize() {
 		if (!initialized) {
-			DatabaseContext dbCtx;
-			DatabaseCapabilityChecker capabilityChecker;
-			
 			LOG.fine("Initializing the database and temporary processing files.");
 			
-			dbCtx = new DatabaseContext(loginCredentials);
-			try {
-				capabilityChecker = new DatabaseCapabilityChecker(dbCtx);
+			try (DatabaseContext dbCtx = new DatabaseContext(loginCredentials)) {
+				DatabaseCapabilityChecker capabilityChecker = new DatabaseCapabilityChecker(dbCtx);
 
 				populateBbox = capabilityChecker.isWayBboxSupported();
 				populateLinestring = capabilityChecker.isWayLinestringSupported();
-			} finally {
-				dbCtx.release();
 			}
 
 			copyFilesetBuilder =
@@ -129,12 +123,12 @@ public class PostgreSqlCopyWriter implements Sink {
 	/**
 	 * Releases all database resources.
 	 */
-	public void release() {
+	public void close() {
 		if (copyFilesetBuilder != null) {
-			copyFilesetBuilder.release();
+			copyFilesetBuilder.close();
 			copyFilesetBuilder = null;
 		}
-		copyFileset.release();
+		copyFileset.close();
 		
 		initialized = false;
 	}
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDatasetReader.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDatasetReader.java
index ee3263a..137fbb7 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDatasetReader.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDatasetReader.java
@@ -53,7 +53,7 @@ public class PostgreSqlDatasetReader implements RunnableDatasetSource, Dataset {
 			datasetSink.process(this);
 			
 		} finally {
-			datasetSink.release();
+			datasetSink.close();
 		}
 	}
 	
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDumpWriter.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDumpWriter.java
index 8c39ddf..4df4bdf 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDumpWriter.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlDumpWriter.java
@@ -84,7 +84,7 @@ public class PostgreSqlDumpWriter implements Sink {
 	/**
 	 * Releases all database resources.
 	 */
-	public void release() {
-		copyFilesetBuilder.release();
+	public void close() {
+		copyFilesetBuilder.close();
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTruncator.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTruncator.java
index ed4341d..1cb83a0 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTruncator.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTruncator.java
@@ -77,7 +77,7 @@ public class PostgreSqlTruncator implements RunnableTask {
 			LOG.fine("Complete.");
 			
 		} finally {
-			dbCtx.release();
+			dbCtx.close();
 		}
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ActionDataType.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ActionDataType.java
index 999a64e..0453c38 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ActionDataType.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ActionDataType.java
@@ -27,9 +27,14 @@ public enum ActionDataType {
 	
 	
 	private final String dbValue;
-	
-	
-	private ActionDataType(String dbValue) {
+
+
+	/**
+	 * Create a new instance.
+	 *
+	 * @param dbValue See {@link ActionDataType#getDatabaseValue()}.
+	 */
+	ActionDataType(String dbValue) {
 		this.dbValue = dbValue;
 	}
 	
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ChangesetAction.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ChangesetAction.java
index 124daf4..b8e6bbe 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ChangesetAction.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/ChangesetAction.java
@@ -29,9 +29,14 @@ public enum ChangesetAction {
 	
 	
 	private final String dbValue;
-	
-	
-	private ChangesetAction(String dbValue) {
+
+
+	/**
+	 * Create a new instance.
+	 *
+	 * @param dbValue See {@link ChangesetAction#getDatabaseValue()}.
+	 */
+	ChangesetAction(String dbValue) {
 		this.dbValue = dbValue;
 	}
 	
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetBuilder.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetBuilder.java
index f67b6a6..33b60b9 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetBuilder.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetBuilder.java
@@ -258,8 +258,8 @@ public class CopyFilesetBuilder implements Sink, EntityProcessor {
 	/**
 	 * Releases all resources.
 	 */
-	public void release() {
-		writerContainer.release();
-		wayGeometryBuilder.release();
+	public void close() {
+		writerContainer.close();
+		wayGeometryBuilder.close();
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetLoader.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetLoader.java
index e7347b6..33e9674 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetLoader.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetLoader.java
@@ -65,9 +65,7 @@ public class CopyFilesetLoader implements Runnable {
      * Reads all data from the database and send it to the sink.
      */
     public void run() {
-    	DatabaseContext dbCtx = new DatabaseContext(loginCredentials);
-    	
-    	try {
+    	try (DatabaseContext dbCtx = new DatabaseContext(loginCredentials)) {
     		DatabaseCapabilityChecker capabilityChecker;
 			IndexManager indexManager;
 			String[] wayColumns;
@@ -119,9 +117,6 @@ public class CopyFilesetLoader implements Runnable {
     		dbCtx.getJdbcTemplate().update("VACUUM ANALYZE");
     		
     		LOG.fine("Complete.");
-    		
-    	} finally {
-    		dbCtx.release();
     	}
     }
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityDao.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityDao.java
index e53539e..2a290c3 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityDao.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityDao.java
@@ -187,7 +187,7 @@ public abstract class EntityDao<T extends Entity> {
 			
 		} finally {
 			if (sortingStore != null) {
-				sortingStore.release();
+				sortingStore.close();
 			}
 		}
 	}
@@ -213,11 +213,7 @@ public abstract class EntityDao<T extends Entity> {
 	 * @return The entity iterator.
 	 */
 	public ReleasableIterator<T> iterate(String tablePrefix) {
-		ReleasableContainer releasableContainer;
-		
-		releasableContainer = new ReleasableContainer();
-		
-		try {
+		try (ReleasableContainer releasableContainer = new ReleasableContainer()) {
 			ReleasableIterator<T> entityIterator;
 			List<FeaturePopulator<T>> featurePopulators;
 			
@@ -240,9 +236,6 @@ public abstract class EntityDao<T extends Entity> {
 			releasableContainer.clear();
 			
 			return entityIterator;
-			
-		} finally {
-			releasableContainer.release();
 		}
 	}
 	
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityReader.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityReader.java
index 0173c9e..a5707e7 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityReader.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityReader.java
@@ -107,7 +107,7 @@ public class EntityReader<T extends Entity> implements ReleasableIterator<T> {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		releasableContainer.release();
+	public void close() {
+		releasableContainer.close();
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/FeaturePopulatorImpl.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/FeaturePopulatorImpl.java
index 01bc9e1..ab1c9fc 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/FeaturePopulatorImpl.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/FeaturePopulatorImpl.java
@@ -60,7 +60,7 @@ public class FeaturePopulatorImpl<Te extends Entity, Tf extends Storeable, Tdbf
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		source.release();
+	public void close() {
+		source.close();
 	}
 }
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/PostgreSqlDatasetContext.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/PostgreSqlDatasetContext.java
index b573e8c..2c02d3f 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/PostgreSqlDatasetContext.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/PostgreSqlDatasetContext.java
@@ -431,9 +431,9 @@ public class PostgreSqlDatasetContext implements DatasetContext {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		if (dbCtx != null) {
-			dbCtx.release();
+			dbCtx.close();
 			
 			dbCtx = null;
 		}
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/RelationDao.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/RelationDao.java
index de1045a..9ef87cb 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/RelationDao.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/RelationDao.java
@@ -164,7 +164,7 @@ public class RelationDao extends EntityDao<Relation> {
 			
 		} finally {
 			if (sortingStore != null) {
-				sortingStore.release();
+				sortingStore.close();
 			}
 		}
 	}
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/TempCopyFileset.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/TempCopyFileset.java
index 5766ea2..7efb1ce 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/TempCopyFileset.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/TempCopyFileset.java
@@ -7,7 +7,7 @@ import java.util.ArrayList;
 import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -16,7 +16,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * @author Brett Henderson
  * 
  */
-public class TempCopyFileset implements CopyFileset, Releasable {
+public class TempCopyFileset implements CopyFileset, Closeable {
 	
 	private static final Logger LOG = Logger.getLogger(TempCopyFileset.class.getName());
 	
@@ -140,7 +140,7 @@ public class TempCopyFileset implements CopyFileset, Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		for (File tmpFile : tmpFiles) {
 			if (!tmpFile.delete()) {
 				// We cannot throw an exception within a release statement.
diff --git a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayGeometryBuilder.java b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayGeometryBuilder.java
index 86c82e1..4135dc5 100644
--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayGeometryBuilder.java
+++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayGeometryBuilder.java
@@ -8,7 +8,7 @@ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.domain.v0_6.Node;
 import org.openstreetmap.osmosis.core.domain.v0_6.Way;
 import org.openstreetmap.osmosis.core.domain.v0_6.WayNode;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 import org.openstreetmap.osmosis.pgsnapshot.common.CompactPersistentNodeLocationStore;
 import org.openstreetmap.osmosis.pgsnapshot.common.InMemoryNodeLocationStore;
 import org.openstreetmap.osmosis.pgsnapshot.common.NodeLocation;
@@ -27,7 +27,7 @@ import org.postgis.Polygon;
  * 
  * @author Brett Henderson
  */
-public class WayGeometryBuilder implements Releasable {
+public class WayGeometryBuilder implements Closeable {
 	
 	/**
 	 * Stores the locations of nodes so that they can be used to build the way
@@ -217,7 +217,7 @@ public class WayGeometryBuilder implements Releasable {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		locationStore.release();
+	public void close() {
+		locationStore.close();
 	}
 }
diff --git a/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/DatasetDriver.java b/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/DatasetDriver.java
index c1a9ff9..540fad8 100644
--- a/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/DatasetDriver.java
+++ b/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/DatasetDriver.java
@@ -44,9 +44,7 @@ public class DatasetDriver implements DatasetSink {
 	 */
 	@Override
 	public void process(Dataset dataset) {
-		DatasetContext dsCtx = dataset.createReader();
-		
-		try {
+		try (DatasetContext dsCtx = dataset.createReader()) {
 			EntityManager<Node> nodeManager = dsCtx.getNodeManager();
 			OsmUser user;
 			Node node;
@@ -71,9 +69,6 @@ public class DatasetDriver implements DatasetSink {
 			nodeManager.addEntity(node);
 			
 			dsCtx.complete();
-			
-		} finally {
-			dsCtx.release();
 		}
 	}
 
@@ -82,7 +77,7 @@ public class DatasetDriver implements DatasetSink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 
diff --git a/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTest.java b/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTest.java
index 76bbc54..bff9b6f 100644
--- a/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTest.java
+++ b/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/PostgreSqlTest.java
@@ -41,7 +41,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsql-0.6",
 				"authFile=" + authFile.getPath()
@@ -50,7 +50,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -61,7 +61,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsql-0.6",
 				"authFile=" + authFile.getPath(),
@@ -101,7 +101,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsql-0.6",
 				"authFile=" + authFile.getPath()
@@ -110,7 +110,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with the snapshot file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				snapshotFile.getPath(),
@@ -121,7 +121,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Apply the changeset file to the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-change-0.6",
 				changesetFile.getPath(),
@@ -133,7 +133,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsql-0.6",
 				"authFile=" + authFile.getPath(),
@@ -171,7 +171,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsql-0.6",
 				"authFile=" + authFile.getPath()
@@ -180,7 +180,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with the snapshot file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				snapshotFile.getPath(),
@@ -191,7 +191,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Invoke the dataset driver task task to manipulate the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"-p",
 				DatasetDriverPlugin.class.getName(),
@@ -203,7 +203,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsql-0.6",
 				"authFile=" + authFile.getPath(),
@@ -240,7 +240,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsql-0.6",
 				"authFile=" + authFile.getPath()
@@ -249,7 +249,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -260,7 +260,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 		
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsql-0.6",
 				"authFile=" + authFile.getPath(),
@@ -296,7 +296,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 
 		// Remove all existing data from the database.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--truncate-pgsql-0.6",
 				"postgresSchema=test_schema",
@@ -306,7 +306,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 
 		// Load the database with a dataset.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -318,7 +318,7 @@ public class PostgreSqlTest extends AbstractDataTest {
 
 		// Dump the database to an osm file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-pgsql-0.6",
 				"authFile=" + authFile.getPath(),
diff --git a/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/NodeLocationStoreTest.java b/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/NodeLocationStoreTest.java
index cfe9705..7d4ce91 100644
--- a/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/NodeLocationStoreTest.java
+++ b/osmosis-pgsnapshot/src/test/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/NodeLocationStoreTest.java
@@ -56,7 +56,7 @@ public class NodeLocationStoreTest {
 			Assert.assertFalse("The node location should be invalid.", location.isValid());
 		}
 		
-		store.release();
+		store.close();
 	}
 	
 	
diff --git a/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql-authfile.txt b/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql-authfile.txt
index 1bc3325..7eccdde 100644
--- a/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql-authfile.txt
+++ b/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql-authfile.txt
@@ -1,4 +1,4 @@
-host=localhost
+host=db
 database=pgosmsnap06_test
 user=osm
 password=password
diff --git a/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql_with_schema-authfile.txt b/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql_with_schema-authfile.txt
index d824913..d25eb12 100644
--- a/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql_with_schema-authfile.txt
+++ b/osmosis-pgsnapshot/src/test/resources/data/template/v0_6/pgsql_with_schema-authfile.txt
@@ -1,4 +1,4 @@
-host=localhost
+host=db
 database=pgosmsnap06_test_with_schema
 user=osm
 password=password
diff --git a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationDataClient.java b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationDataClient.java
index 2ab41bb..640169d 100644
--- a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationDataClient.java
+++ b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationDataClient.java
@@ -110,7 +110,7 @@ public class ReplicationDataClient implements RunnableChangeSource {
 
 
 		@Override
-		public void release() {
+		public void close() {
 			// Do nothing.
 		}
 
@@ -121,7 +121,7 @@ public class ReplicationDataClient implements RunnableChangeSource {
 		 * the change sink release method.
 		 */
 		public void realRelease() {
-			changeSink.release();
+			changeSink.close();
 		}
 	}
 }
diff --git a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServer.java b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServer.java
index e251db3..521aaef 100644
--- a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServer.java
+++ b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServer.java
@@ -111,8 +111,8 @@ public class ReplicationSequenceServer implements ChangeSinkChangeSource {
 
 
 	@Override
-	public void release() {
-		changeSink.release();
+	public void close() {
+		changeSink.close();
 
 		if (serverStarted) {
 			try {
diff --git a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ChunkedDataReceiver.java b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ChunkedDataReceiver.java
index c7b6f01..456fa71 100644
--- a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ChunkedDataReceiver.java
+++ b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ChunkedDataReceiver.java
@@ -15,7 +15,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
 import org.jboss.netty.buffer.ChannelBuffers;
 import org.jboss.netty.util.CharsetUtil;
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
-import org.openstreetmap.osmosis.core.lifecycle.Releasable;
+import org.openstreetmap.osmosis.core.lifecycle.Closeable;
 
 
 /**
@@ -25,7 +25,7 @@ import org.openstreetmap.osmosis.core.lifecycle.Releasable;
  * 
  * @author Brett Henderson
  */
-public class ChunkedDataReceiver implements Releasable {
+public class ChunkedDataReceiver implements Closeable {
 
 	private static final Logger LOG = Logger.getLogger(ChunkedDataReceiver.class.getName());
 
@@ -195,7 +195,7 @@ public class ChunkedDataReceiver implements Releasable {
 
 
 	@Override
-	public void release() {
+	public void close() {
 		if (tmpDataChannel != null) {
 			try {
 				tmpDataChannel.close();
diff --git a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataClientHandler.java b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataClientHandler.java
index 9f688b6..070aaa5 100644
--- a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataClientHandler.java
+++ b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataClientHandler.java
@@ -179,7 +179,7 @@ public class ReplicationDataClientHandler extends SequenceClientHandler {
 	@Override
 	public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
 		// Release any half populated chunk files.
-		chunkReceiver.release();
+		chunkReceiver.close();
 
 		super.channelClosed(ctx, e);
 	}
@@ -200,7 +200,7 @@ public class ReplicationDataClientHandler extends SequenceClientHandler {
 		 * @param changeSink
 		 *            The wrapped change sink.
 		 */
-		public NoLifecycleChangeSinkWrapper(ChangeSink changeSink) {
+		NoLifecycleChangeSinkWrapper(ChangeSink changeSink) {
 			this.changeSink = changeSink;
 		}
 
@@ -224,7 +224,7 @@ public class ReplicationDataClientHandler extends SequenceClientHandler {
 
 
 		@Override
-		public void release() {
+		public void close() {
 			// Do nothing.
 		}
 	}
diff --git a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataServerHandler.java b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataServerHandler.java
index 5f1d2f5..8e59d62 100644
--- a/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataServerHandler.java
+++ b/osmosis-replication-http/src/main/java/org/openstreetmap/osmosis/replicationhttp/v0_6/impl/ReplicationDataServerHandler.java
@@ -213,9 +213,7 @@ public class ReplicationDataServerHandler extends SequenceServerHandler {
 
 
 	private ChannelBuffer loadFile(File file) {
-		FileChannel fileChannel = openFileChannel(file);
-
-		try {
+		try (FileChannel fileChannel = openFileChannel(file)) {
 			if (fileChannel.size() > Integer.MAX_VALUE) {
 				throw new OsmosisRuntimeException("Maximum file size supported is " + Integer.MAX_VALUE + " bytes");
 			}
@@ -233,12 +231,6 @@ public class ReplicationDataServerHandler extends SequenceServerHandler {
 
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read from file " + file, e);
-		} finally {
-			try {
-				fileChannel.close();
-			} catch (IOException e) {
-				LOG.log(Level.WARNING, "Unable to close channel for file " + file, e);
-			}
 		}
 	}
 
diff --git a/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationDestination.java b/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationDestination.java
index 633d3c1..7405706 100644
--- a/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationDestination.java
+++ b/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationDestination.java
@@ -87,7 +87,7 @@ public class MockReplicationDestination implements ChangeSink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Do nothing.
 	}
 	
diff --git a/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationSource.java b/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationSource.java
index 2726a08..870c390 100644
--- a/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationSource.java
+++ b/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/MockReplicationSource.java
@@ -75,6 +75,6 @@ public class MockReplicationSource implements ChangeSource {
 	 * Releases all downstream resources.
 	 */
 	public void release() {
-		changeSink.release();
+		changeSink.close();
 	}
 }
diff --git a/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServerTest.java b/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServerTest.java
index d885ec1..1de091e 100644
--- a/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServerTest.java
+++ b/osmosis-replication-http/src/test/java/org/openstreetmap/osmosis/replicationhttp/v0_6/ReplicationSequenceServerTest.java
@@ -40,7 +40,7 @@ public class ReplicationSequenceServerTest extends AbstractDataTest {
 				server.complete();
 			}
 		} finally {
-			server.release();
+			server.close();
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/ServerStateReader.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/ServerStateReader.java
index 62c283d..175ebe5 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/ServerStateReader.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/ServerStateReader.java
@@ -3,7 +3,6 @@ package org.openstreetmap.osmosis.replication.common;
 
 import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -12,8 +11,6 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.OsmosisConstants;
@@ -23,7 +20,6 @@ import org.openstreetmap.osmosis.core.OsmosisConstants;
  * Retrieves replication state files from the server hosting replication data.
  */
 public class ServerStateReader {
-	private static final Logger LOG = Logger.getLogger(ServerStateReader.class.getName());
 	private static final String SERVER_STATE_FILE = "state.txt";
 	private static final String SEQUENCE_STATE_FILE_SUFFIX = ".state.txt";
 	
@@ -76,7 +72,6 @@ public class ServerStateReader {
 	 */
 	private ReplicationState getServerState(URL baseUrl, String stateFile) {
 		URL stateUrl;
-		InputStream stateStream = null;
 		
 		try {
 			stateUrl = new URL(baseUrl, stateFile);
@@ -85,7 +80,6 @@ public class ServerStateReader {
 		}
 		
 		try {
-			BufferedReader reader;
 			Properties stateProperties;
 			Map<String, String> stateMap;
 			ReplicationState state;
@@ -94,11 +88,12 @@ public class ServerStateReader {
 			connection.setReadTimeout(15 * 60 * 1000); // timeout 15 minutes
 			connection.setConnectTimeout(15 * 60 * 1000); // timeout 15 minutes
 			connection.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
-			stateStream = connection.getInputStream();
-			
-			reader = new BufferedReader(new InputStreamReader(stateStream));
-			stateProperties = new Properties();
-			stateProperties.load(reader);
+			try (BufferedReader reader  = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
+				stateProperties = new Properties();
+				stateProperties.load(reader);
+			} catch (IOException e) {
+				throw new OsmosisRuntimeException("Unable to read the state from the server.", e);
+			}
 			
 			stateMap = new HashMap<String, String>();
 			for (Entry<Object, Object> property : stateProperties.entrySet()) {
@@ -107,22 +102,10 @@ public class ServerStateReader {
 			
 			state = new ReplicationState(stateMap);
 			
-			stateStream.close();
-			stateStream = null;
-			
 			return state;
 			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read the state from the server.", e);
-		} finally {
-			try {
-				if (stateStream != null) {
-					stateStream.close();
-				}
-			} catch (IOException e) {
-				// We are already in an error condition so log and continue.
-				LOG.log(Level.WARNING, "Unable to close state stream.", e);
-			}
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/TimestampTracker.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/TimestampTracker.java
index c0c1270..4b1ab7f 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/TimestampTracker.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/TimestampTracker.java
@@ -8,8 +8,6 @@ import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.util.Date;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
 import org.openstreetmap.osmosis.core.time.DateFormatter;
@@ -24,9 +22,6 @@ import org.openstreetmap.osmosis.core.time.DateParser;
  */
 public class TimestampTracker {
 	
-	private static final Logger LOG = Logger.getLogger(TimestampTracker.class.getName());
-	
-	
 	private File timestampFile;
 	private File newTimestampFile;
 	private DateParser dateParser;
@@ -82,32 +77,12 @@ public class TimestampTracker {
 	 * @return The time.
 	 */
 	public Date getTime() {
-		FileReader fileReader = null;
 		
-		try {
-			BufferedReader reader;
-			Date result;
-			
-			fileReader = new FileReader(timestampFile);
-			reader = new BufferedReader(fileReader);
-			
-			result = dateParser.parse(reader.readLine());
-			
-			fileReader.close();
-			fileReader = null;
-			
-			return result;
+		try (BufferedReader reader = new BufferedReader(new FileReader(timestampFile))) {
+			return dateParser.parse(reader.readLine());
 			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read the time from file " + timestampFile + ".", e);
-		} finally {
-			if (fileReader != null) {
-				try {
-				fileReader.close();
-				} catch (Exception e) {
-					LOG.log(Level.WARNING, "Unable to close time file " + timestampFile + ".", e);
-				}
-			}
 		}
 	}
 	
@@ -119,31 +94,14 @@ public class TimestampTracker {
 	 *            The time to set.
 	 */
 	public void setTime(Date time) {
-		FileWriter fileWriter = null;
-		
-		try {
-			BufferedWriter writer;
-			
-			fileWriter = new FileWriter(newTimestampFile);
-			writer = new BufferedWriter(fileWriter);
-			
+		try (BufferedWriter writer = new BufferedWriter(new FileWriter(newTimestampFile))) {
 			writer.write(dateFormatter.format(time));
 			
-			writer.close();
-			
-			renameNewFileToCurrent();
-			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException(
 					"Unable to write the time to temporary file " + newTimestampFile + ".", e);
-		} finally {
-			if (fileWriter != null) {
-				try {
-					fileWriter.close();
-				} catch (Exception e) {
-					LOG.log(Level.WARNING, "Unable to close temporary time file " + newTimestampFile + ".", e);
-				}
-			}
 		}
+
+		renameNewFileToCurrent();
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/BaseReplicationDownloader.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/BaseReplicationDownloader.java
index be5d09a..6f46093 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/BaseReplicationDownloader.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/BaseReplicationDownloader.java
@@ -6,15 +6,12 @@ import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Map;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
@@ -86,8 +83,6 @@ public abstract class BaseReplicationDownloader implements RunnableTask {
 	 */
 	private File downloadReplicationFile(String fileName, URL baseUrl) {
 		URL changesetUrl;
-		InputStream inputStream = null;
-		OutputStream outputStream = null;
 		
 		try {
 			changesetUrl = new URL(baseUrl, fileName);
@@ -96,60 +91,32 @@ public abstract class BaseReplicationDownloader implements RunnableTask {
 		}
 		
 		try {
-			BufferedInputStream source;
-			BufferedOutputStream sink;
 			File outputFile;
-			byte[] buffer;
 			
 			// Open an input stream for the changeset file on the server.
 			URLConnection connection = changesetUrl.openConnection();
 			connection.setReadTimeout(15 * 60 * 1000); // timeout 15 minutes
 			connection.setConnectTimeout(15 * 60 * 1000); // timeout 15 minutes
 			connection.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
-			inputStream = connection.getInputStream();
-			source = new BufferedInputStream(inputStream, 65536);
 			
-			// Create a temporary file to write the data to.
-			outputFile = File.createTempFile("change", null);
-			
-			// Open a output stream for the destination file.
-			outputStream = new FileOutputStream(outputFile);
-			sink = new BufferedOutputStream(outputStream, 65536);
-			
-			// Download the file.
-			buffer = new byte[65536];
-			for (int bytesRead = source.read(buffer); bytesRead > 0; bytesRead = source.read(buffer)) {
-				sink.write(buffer, 0, bytesRead);
+			try (BufferedInputStream source = new BufferedInputStream(connection.getInputStream(), 65536)) {
+				// Create a temporary file to write the data to.
+				outputFile = File.createTempFile("change", null);
+
+				// Open a output stream for the destination file.
+				try (BufferedOutputStream sink = new BufferedOutputStream(new FileOutputStream(outputFile), 65536)) {
+					// Download the file.
+					byte[] buffer = new byte[65536];
+					for (int bytesRead = source.read(buffer); bytesRead > 0; bytesRead = source.read(buffer)) {
+						sink.write(buffer, 0, bytesRead);
+					}
+				}
 			}
-			sink.flush();
-			
-			// Clean up all file handles.
-			inputStream.close();
-			inputStream = null;
-			outputStream.close();
-			outputStream = null;
 			
 			return outputFile;
 			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read the changeset file " + fileName + " from the server.", e);
-		} finally {
-			try {
-				if (inputStream != null) {
-					inputStream.close();
-				}
-			} catch (IOException e) {
-				// We are already in an error condition so log and continue.
-				LOG.log(Level.WARNING, "Unable to changeset download stream.", e);
-			}
-			try {
-				if (outputStream != null) {
-					outputStream.close();
-				}
-			} catch (IOException e) {
-				// We are already in an error condition so log and continue.
-				LOG.log(Level.WARNING, "Unable to changeset output stream.", e);
-			}
 		}
 	}
 	
@@ -385,7 +352,7 @@ public abstract class BaseReplicationDownloader implements RunnableTask {
 			fileLock.unlock();
 			
 		} finally {
-			fileLock.release();
+			fileLock.close();
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloader.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloader.java
index 6df0990..310cf8e 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloader.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloader.java
@@ -7,9 +7,7 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.OutputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
@@ -97,7 +95,6 @@ public class IntervalDownloader implements RunnableChangeSource {
 	 */
 	private Date getServerTimestamp(URL baseUrl) {
 		URL timestampUrl;
-		InputStream timestampStream = null;
 		
 		try {
 			timestampUrl = new URL(baseUrl, SERVER_TSTAMP_FILE);
@@ -106,35 +103,21 @@ public class IntervalDownloader implements RunnableChangeSource {
 		}
 		
 		try {
-			BufferedReader reader;
 			Date result;
 			
 			URLConnection connection = timestampUrl.openConnection();
 			connection.setReadTimeout(15 * 60 * 1000); // timeout 15 minutes
 			connection.setConnectTimeout(15 * 60 * 1000); // timeout 15 minutes
 			connection.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
-			timestampStream = connection.getInputStream();
 			
-			reader = new BufferedReader(new InputStreamReader(timestampStream));
-			
-			result = dateParser.parse(reader.readLine());
-			
-			timestampStream.close();
-			timestampStream = null;
+			try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
+				result = dateParser.parse(reader.readLine());
+			}
 			
 			return result;
 			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read the timestamp from the server.", e);
-		} finally {
-			try {
-				if (timestampStream != null) {
-					timestampStream.close();
-				}
-			} catch (IOException e) {
-				// We are already in an error condition so log and continue.
-				LOG.log(Level.WARNING, "Unable to close timestamp stream.", e);
-			}
 		}
 	}
 	
@@ -151,8 +134,6 @@ public class IntervalDownloader implements RunnableChangeSource {
 	 */
 	private File downloadChangesetFile(String fileName, URL baseUrl) {
 		URL changesetUrl;
-		InputStream inputStream = null;
-		OutputStream outputStream = null;
 		
 		try {
 			changesetUrl = new URL(baseUrl, fileName);
@@ -161,59 +142,31 @@ public class IntervalDownloader implements RunnableChangeSource {
 		}
 		
 		try {
-			BufferedInputStream source;
-			BufferedOutputStream sink;
 			File outputFile;
-			byte[] buffer;
 			
 			// Open an input stream for the changeset file on the server.
 			URLConnection connection = changesetUrl.openConnection();
 			connection.setReadTimeout(15 * 60 * 1000); // timeout 15 minutes
 			connection.setConnectTimeout(15 * 60 * 1000); // timeout 15 minutes
-			inputStream = connection.getInputStream();
-			source = new BufferedInputStream(inputStream, 65536);
-			
-			// Create a temporary file to write the data to.
-			outputFile = File.createTempFile("change", null);
-			
-			// Open a output stream for the destination file.
-			outputStream = new FileOutputStream(outputFile);
-			sink = new BufferedOutputStream(outputStream, 65536);
-			
-			// Download the file.
-			buffer = new byte[65536];
-			for (int bytesRead = source.read(buffer); bytesRead > 0; bytesRead = source.read(buffer)) {
-				sink.write(buffer, 0, bytesRead);
+			try (BufferedInputStream source = new BufferedInputStream(connection.getInputStream(), 65536)) {
+
+				// Create a temporary file to write the data to.
+				outputFile = File.createTempFile("change", null);
+				
+				// Open a output stream for the destination file.
+				try (BufferedOutputStream sink = new BufferedOutputStream(new FileOutputStream(outputFile), 65536)) {
+					// Download the file.
+					byte[] buffer = new byte[65536];
+					for (int bytesRead = source.read(buffer); bytesRead > 0; bytesRead = source.read(buffer)) {
+						sink.write(buffer, 0, bytesRead);
+					}
+				}
 			}
-			sink.flush();
-			
-			// Clean up all file handles.
-			inputStream.close();
-			inputStream = null;
-			outputStream.close();
-			outputStream = null;
 			
 			return outputFile;
 			
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read the changeset file " + fileName + " from the server.", e);
-		} finally {
-			try {
-				if (inputStream != null) {
-					inputStream.close();
-				}
-			} catch (IOException e) {
-				// We are already in an error condition so log and continue.
-				LOG.log(Level.WARNING, "Unable to changeset download stream.", e);
-			}
-			try {
-				if (outputStream != null) {
-					outputStream.close();
-				}
-			} catch (IOException e) {
-				// We are already in an error condition so log and continue.
-				LOG.log(Level.WARNING, "Unable to changeset output stream.", e);
-			}
 		}
 	}
 	
@@ -408,8 +361,8 @@ public class IntervalDownloader implements RunnableChangeSource {
 			fileLock.unlock();
 			
 		} finally {
-			changeSink.release();
-			fileLock.release();
+			changeSink.close();
+			fileLock.close();
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloaderInitializer.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloaderInitializer.java
index 7dfce91..ed4edec 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloaderInitializer.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloaderInitializer.java
@@ -94,7 +94,7 @@ public class IntervalDownloaderInitializer implements RunnableTask {
 			fileLock.unlock();
 			
 		} finally {
-			fileLock.release();
+			fileLock.close();
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloader.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloader.java
index 881ee01..9baec95 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloader.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloader.java
@@ -100,7 +100,7 @@ public class ReplicationDownloader extends BaseReplicationDownloader implements
 				// Suppress the call.
 			}
 			@Override
-			public void release() {
+			public void close() {
 				// Suppress the call.
 			} });
 		
@@ -122,6 +122,6 @@ public class ReplicationDownloader extends BaseReplicationDownloader implements
 	 */
 	@Override
 	protected void processRelease() {
-		changeSorter.release();
+		changeSorter.close();
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloaderInitializer.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloaderInitializer.java
index 3472403..2cffaca 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloaderInitializer.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationDownloaderInitializer.java
@@ -76,7 +76,7 @@ public class ReplicationDownloaderInitializer implements RunnableTask {
 			fileLock.unlock();
 			
 		} finally {
-			fileLock.release();
+			fileLock.close();
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMerger.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMerger.java
index 88472bb..f4f03ee 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMerger.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMerger.java
@@ -156,7 +156,7 @@ public class ReplicationFileMerger extends BaseReplicationDownloader {
 
 
 			@Override
-			public void release() {
+			public void close() {
 				// Suppress the call.
 			}
 		});
@@ -264,7 +264,7 @@ public class ReplicationFileMerger extends BaseReplicationDownloader {
 				LOG.finer("Closing change sink for interval with sequence number "
 						+ currentDataState.getSequenceNumber());
 				changeSink.complete();
-				changeSink.release();
+				changeSink.close();
 
 				replicationStore.saveState(currentDataState);
 
@@ -305,7 +305,7 @@ public class ReplicationFileMerger extends BaseReplicationDownloader {
 			changeSink.complete();
 			replicationStore.saveState(currentDataState);
 
-			changeSink.release();
+			changeSink.close();
 			changeSink = null;
 
 			sinkActive = false;
@@ -319,7 +319,7 @@ public class ReplicationFileMerger extends BaseReplicationDownloader {
 	@Override
 	protected void processRelease() {
 		if (sinkActive) {
-			changeSink.release();
+			changeSink.close();
 			sinkActive = false;
 		}
 	}
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMergerInitializer.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMergerInitializer.java
index 4bc68fb..a8c1ffc 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMergerInitializer.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationFileMergerInitializer.java
@@ -83,7 +83,7 @@ public class ReplicationFileMergerInitializer implements RunnableTask {
 			fileLock.unlock();
 			
 		} finally {
-			fileLock.release();
+			fileLock.close();
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationLagReader.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationLagReader.java
index 4854295..0e6f81a 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationLagReader.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationLagReader.java
@@ -156,7 +156,7 @@ public class ReplicationLagReader implements RunnableTask {
 			fileLock.unlock();
 			
 		} finally {
-			fileLock.release();
+			fileLock.close();
 		}
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationStateWriter.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationStateWriter.java
index 82c845f..5e79961 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationStateWriter.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationStateWriter.java
@@ -112,10 +112,10 @@ public class ReplicationStateWriter implements ChangeSink {
 
 
 	@Override
-	public void release() {
+	public void close() {
 		state = null;
 
-		fileLock.release();
+		fileLock.close();
 		lockObtained = false;
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationToChangeWriter.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationToChangeWriter.java
index 44cae87..a9b9619 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationToChangeWriter.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationToChangeWriter.java
@@ -89,8 +89,8 @@ public class ReplicationToChangeWriter implements ChangeSinkChangeSource {
 
 
 	@Override
-	public void release() {
-		changeSink.release();
-		stateWriter.release();
+	public void close() {
+		changeSink.close();
+		stateWriter.close();
 	}
 }
diff --git a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationWriter.java b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationWriter.java
index 2f1f4a4..f267305 100644
--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationWriter.java
+++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationWriter.java
@@ -66,7 +66,7 @@ public class ReplicationWriter implements ChangeSink {
 		if (state.getSequenceNumber() > 0) {
 			// Complete the writing of the change file.
 			changeWriter.complete();
-			changeWriter.release();
+			changeWriter.close();
 			changeWriter = null;
 		}
 
@@ -80,11 +80,11 @@ public class ReplicationWriter implements ChangeSink {
 
 
 	@Override
-	public void release() {
+	public void close() {
 		if (changeWriter != null) {
-			changeWriter.release();
+			changeWriter.close();
 			changeWriter = null;
 		}
-		stateWriter.release();
+		stateWriter.close();
 	}
 }
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/BoundRemovedAction.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/BoundRemovedAction.java
index 6fcbaaa..87b1644 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/BoundRemovedAction.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/BoundRemovedAction.java
@@ -11,21 +11,26 @@ public enum BoundRemovedAction {
 	/**
 	 * Continue processing quietly.
 	 */
-	Ignore ("ignore"),
+	Ignore("ignore"),
 	
 	/**
 	 * Continue processing but emit a warning to the log.
 	 */
-	Warn ("warn"),
+	Warn("warn"),
 	
 	/**
 	 * Stop processing and emit an error message to the log.
 	 */
-	Fail ("fail");
+	Fail("fail");
 	
 	private final String keyword;
-	
-	private BoundRemovedAction(String keyword) {
+
+	/**
+	 * Create a new instance.
+	 *
+	 * @param keyword The string representation of this enum instance.
+	 */
+	BoundRemovedAction(String keyword) {
 		this.keyword = keyword;
 	}
 	
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppender.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppender.java
index 245fc47..76d2c29 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppender.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppender.java
@@ -105,7 +105,7 @@ public class ChangeAppender implements MultiChangeSinkRunnableChangeSource {
 			}
 		
 		} finally {
-			changeSink.release();
+			changeSink.close();
 
 			// Release all input sources.
 			for (DataPostbox<ChangeContainer> source : sources) {
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplier.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplier.java
index 00cdecc..90bf33b 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplier.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplier.java
@@ -235,7 +235,7 @@ public class ChangeApplier implements MultiSinkMultiChangeSinkRunnableSource {
 			changePostbox.outputComplete();
 			
 		} finally {
-			sink.release();
+			sink.close();
 			
 			basePostbox.outputRelease();
 			changePostbox.outputRelease();
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriver.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriver.java
index 007f483..b1d3176 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriver.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriver.java
@@ -175,7 +175,7 @@ public class ChangeDeriver implements MultiSinkRunnableChangeSource {
 			toPostbox.outputComplete();
 			
 		} finally {
-			changeSink.release();
+			changeSink.close();
 			
 			fromPostbox.outputRelease();
 			toPostbox.outputRelease();
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeMerger.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeMerger.java
index a0f0975..4316063 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeMerger.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeMerger.java
@@ -199,7 +199,7 @@ public class ChangeMerger implements MultiChangeSinkRunnableChangeSource {
 			postbox1.outputComplete();
 			
 		} finally {
-			changeSink.release();
+			changeSink.close();
 			
 			postbox0.outputRelease();
 			postbox1.outputRelease();
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifier.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifier.java
index fbf4f32..300a741 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifier.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifier.java
@@ -64,8 +64,8 @@ public class ChangeSimplifier implements ChangeSinkChangeSource {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		orderingValidator.release();
+	public void close() {
+		orderingValidator.close();
 	}
 
 
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeToFullHistoryConvertor.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeToFullHistoryConvertor.java
index 21edf7e..85685af 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeToFullHistoryConvertor.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/ChangeToFullHistoryConvertor.java
@@ -68,7 +68,7 @@ public class ChangeToFullHistoryConvertor implements ChangeSinkSource {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 }
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/EntityMerger.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/EntityMerger.java
index 9c2bfc1..5457441 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/EntityMerger.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/EntityMerger.java
@@ -246,7 +246,7 @@ public class EntityMerger implements MultiSinkRunnableSource {
 			postbox1.outputComplete();
 			
 		} finally {
-			sink.release();
+			sink.close();
 			
 			postbox0.outputRelease();
 			postbox1.outputRelease();
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilter.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilter.java
index d8e0278..dacf9a9 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilter.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilter.java
@@ -67,8 +67,8 @@ public class FlattenFilter extends SortedDuplicateEntityPipeValidator {
 
 
 		@Override
-		public void release() {
-			sink.release();
+		public void close() {
+			sink.close();
 		}
 	};
 
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/ChangeSimplifierImpl.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/ChangeSimplifierImpl.java
index d503779..3bbfdc5 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/ChangeSimplifierImpl.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/ChangeSimplifierImpl.java
@@ -110,8 +110,8 @@ public class ChangeSimplifierImpl implements ChangeSinkChangeSource {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		changeSink.release();
+	public void close() {
+		changeSink.close();
 	}
 
 
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxChangeSink.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxChangeSink.java
index 8c71600..3c790ee 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxChangeSink.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxChangeSink.java
@@ -59,7 +59,7 @@ public class DataPostboxChangeSink implements ChangeSink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		postbox.release();
+	public void close() {
+		postbox.close();
 	}
 }
diff --git a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxSink.java b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxSink.java
index a54fc52..f4c9427 100644
--- a/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxSink.java
+++ b/osmosis-set/src/main/java/org/openstreetmap/osmosis/set/v0_6/impl/DataPostboxSink.java
@@ -59,7 +59,7 @@ public class DataPostboxSink implements Sink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
-		postbox.release();
+	public void close() {
+		postbox.close();
 	}
 }
diff --git a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppenderTest.java b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppenderTest.java
index b58de74..d304dd0 100644
--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppenderTest.java
+++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeAppenderTest.java
@@ -37,7 +37,7 @@ public class ChangeAppenderTest extends AbstractDataTest  {
 		
 		// Append the two source files into the destination file.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-change-0.6",
 				sourceFile2.getPath(),
diff --git a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplierTest.java b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplierTest.java
index fc294ae..255c519 100644
--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplierTest.java
+++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeApplierTest.java
@@ -209,7 +209,7 @@ public class ChangeApplierTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 
 		Osmosis.run(
-				new String [] {
+				new String[] {
 					"-q",
 					"--read-xml-change-0.6", changeFile.getPath(),
 					"--read-xml-0.6", sourceFile.getPath(),
diff --git a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriverTest.java b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriverTest.java
index 79170dd..cc5137f 100644
--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriverTest.java
+++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeDeriverTest.java
@@ -121,7 +121,7 @@ public class ChangeDeriverTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 
 		Osmosis.run(
-				new String [] {
+				new String[] {
 					"-q",
 					"--read-xml-0.6", rightFile.getPath(),
 					"--read-xml-0.6", leftFile.getPath(),
diff --git a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifierTest.java b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifierTest.java
index cd552b8..2ac0eab 100644
--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifierTest.java
+++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifierTest.java
@@ -45,7 +45,7 @@ public class ChangeSimplifierTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 		
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-change-0.6",
 				sourceFile.getPath(),
@@ -77,7 +77,7 @@ public class ChangeSimplifierTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 
 		Osmosis.run(
-				new String [] {
+				new String[] {
 					"-q",
 					"--read-xml-change-0.6", sourceFile.getPath(),
 					"--simplify-change-0.6",
@@ -104,7 +104,7 @@ public class ChangeSimplifierTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 
 		Osmosis.run(
-				new String [] {
+				new String[] {
 					"-q",
 					"--read-empty-change-0.6",
 					"--simplify-change-0.6",
diff --git a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/EntityMergerTest.java b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/EntityMergerTest.java
index ce2215b..c90b5d8 100644
--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/EntityMergerTest.java
+++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/EntityMergerTest.java
@@ -42,7 +42,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile.getPath(),
 				"--read-empty-0.6",
@@ -73,7 +73,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-empty-0.6",
 				"--read-xml-0.6", sourceFile.getPath(),
@@ -106,7 +106,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile2.getPath(),
 				"--read-xml-0.6", sourceFile1.getPath(),
@@ -139,7 +139,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile2.getPath(),
 				"--read-xml-0.6", sourceFile1.getPath(),
@@ -156,7 +156,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile1.getPath(),
 				"--read-xml-0.6", sourceFile2.getPath(),
@@ -191,7 +191,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile2.getPath(),
 				"--read-xml-0.6", sourceFile1.getPath(),
@@ -208,7 +208,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile1.getPath(),
 				"--read-xml-0.6", sourceFile2.getPath(),
@@ -243,7 +243,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile2.getPath(),
 				"--read-xml-0.6", sourceFile1.getPath(),
@@ -265,7 +265,7 @@ public class EntityMergerTest extends AbstractDataTest {
 
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile1.getPath(),
 				"--read-xml-0.6", sourceFile2.getPath(),
@@ -300,7 +300,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile2.getPath(),
 				"--read-xml-0.6", sourceFile1.getPath(),
@@ -316,7 +316,7 @@ public class EntityMergerTest extends AbstractDataTest {
 		
 		// Run the merge.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile1.getPath(),
 				"--read-xml-0.6", sourceFile2.getPath(),
diff --git a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilterTest.java b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilterTest.java
index a484d32..176805c 100644
--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilterTest.java
+++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/FlattenFilterTest.java
@@ -32,7 +32,7 @@ public class FlattenFilterTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 		
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6", sourceFile.getPath(),
 				"--flatten-0.6",
@@ -62,7 +62,7 @@ public class FlattenFilterTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 
 		Osmosis.run(
-				new String [] {
+				new String[] {
 					"-q",
 					"--read-xml-0.6", sourceFile.getPath(),
 					"--flatten-0.6",
@@ -89,7 +89,7 @@ public class FlattenFilterTest extends AbstractDataTest {
 		actualOutputFile = dataUtils.newFile();
 
 		Osmosis.run(
-				new String [] {
+				new String[] {
 					"-q",
 					"--read-empty-0.6",
 					"--flatten-0.6",
diff --git a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/MergeBoundTest.java b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/MergeBoundTest.java
index a705e57..7b7a7cd 100644
--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/MergeBoundTest.java
+++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/MergeBoundTest.java
@@ -197,7 +197,7 @@ public class MergeBoundTest {
 		private Bound bound;
 		private boolean publishBound;
 
-		public BoundSource(Bound bound, boolean publishBound) {
+		BoundSource(Bound bound, boolean publishBound) {
 			if (bound == null) {
 				throw new IllegalArgumentException("bound must not be null");
 			}
@@ -221,7 +221,7 @@ public class MergeBoundTest {
 				sink.process(new NodeContainer(createNode()));
 				sink.complete();
 			} finally {
-				sink.release();
+				sink.close();
 			}
 		}
 		
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyFilter.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyFilter.java
index d658eff..9593da3 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyFilter.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyFilter.java
@@ -117,8 +117,8 @@ public class NodeKeyFilter implements SinkSource, EntityProcessor {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 
 
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilter.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilter.java
index 37530da..55f0923 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilter.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilter.java
@@ -151,8 +151,8 @@ public class NodeKeyValueFilter implements SinkSource, EntityProcessor {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 
 
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilter.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilter.java
index d6e52c1..43427c7 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilter.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilter.java
@@ -154,8 +154,8 @@ public class TagFilter implements SinkSource {
     /**
      * {@inheritDoc}
      */
-    public void release() {
-        sink.release();
+    public void close() {
+        sink.close();
     }
 
 
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemover.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemover.java
index c00ba52..a3198d7 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemover.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemover.java
@@ -105,7 +105,7 @@ public class TagRemover implements SinkSource {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 }
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedNodeFilter.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedNodeFilter.java
index ae73db7..dc34f2d 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedNodeFilter.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedNodeFilter.java
@@ -145,7 +145,7 @@ public class UsedNodeFilter implements SinkSource, EntityProcessor {
 			}
 			sink.process(nodeContainer);
 		}
-		nodeIterator.release();
+		nodeIterator.close();
 		nodeIterator = null;
 
 		// send on all ways
@@ -153,7 +153,7 @@ public class UsedNodeFilter implements SinkSource, EntityProcessor {
 		while (wayIterator.hasNext()) {
 			sink.process(wayIterator.next());
 		}
-		wayIterator.release();
+		wayIterator.close();
 		wayIterator = null;
 
 		// send on all relations
@@ -161,7 +161,7 @@ public class UsedNodeFilter implements SinkSource, EntityProcessor {
 		while (relationIterator.hasNext()) {
 			sink.process(relationIterator.next());
 		}
-		relationIterator.release();
+		relationIterator.close();
 		relationIterator = null;
 
 		// done
@@ -172,17 +172,17 @@ public class UsedNodeFilter implements SinkSource, EntityProcessor {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (allNodes != null) {
-			allNodes.release();
+			allNodes.close();
 		}
 		if (allWays != null) {
-			allWays.release();			
+			allWays.close();			
 		}
 		if (allRelations != null) {
-			allRelations.release();
+			allRelations.close();
 		}
-		sink.release();
+		sink.close();
 	}
 	
 	
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedWayFilter.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedWayFilter.java
index 01bb2a7..25c9b07 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedWayFilter.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/UsedWayFilter.java
@@ -127,7 +127,7 @@ public class UsedWayFilter implements SinkSource, EntityProcessor {
     while (nodeIterator.hasNext()) {
       sink.process(nodeIterator.next());
     }
-    nodeIterator.release();
+    nodeIterator.close();
     nodeIterator = null;
 
 		// send on all required ways
@@ -140,7 +140,7 @@ public class UsedWayFilter implements SinkSource, EntityProcessor {
 			}
 			sink.process(wayContainer);
 		}
-		wayIterator.release();
+		wayIterator.close();
 		wayIterator = null;
 
 		// send on all relations
@@ -148,7 +148,7 @@ public class UsedWayFilter implements SinkSource, EntityProcessor {
 		while (relationIterator.hasNext()) {
 			sink.process(relationIterator.next());
 		}
-		relationIterator.release();
+		relationIterator.close();
 		relationIterator = null;
 
 		// done
@@ -159,17 +159,17 @@ public class UsedWayFilter implements SinkSource, EntityProcessor {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
+	public void close() {
 		if (allNodes != null) {
-			allNodes.release();
+			allNodes.close();
 		}
 		if (allWays != null) {
-			allWays.release();			
+			allWays.close();			
 		}
 		if (allRelations != null) {
-			allRelations.release();
+			allRelations.close();
 		}
-		sink.release();
+		sink.close();
 	}
 	
 	
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyFilter.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyFilter.java
index 4581007..81546ff 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyFilter.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyFilter.java
@@ -118,8 +118,8 @@ public class WayKeyFilter implements SinkSource, EntityProcessor {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 
 
diff --git a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilter.java b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilter.java
index 5a01381..c670d9b 100644
--- a/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilter.java
+++ b/osmosis-tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilter.java
@@ -153,8 +153,8 @@ public class WayKeyValueFilter implements SinkSource, EntityProcessor {
 	/**
 	 * {@inheritDoc}
 	 */
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 	
 	
diff --git a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilterTest.java b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilterTest.java
index 5fc1a65..135b7b1 100644
--- a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilterTest.java
+++ b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilterTest.java
@@ -52,7 +52,7 @@ public class NodeKeyValueFilterTest extends AbstractDataTest {
 		
 		// filter by key-value pairs
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",					
 				"--read-xml-0.6",
 				inputFile.getPath(),
diff --git a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilterTest.java b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilterTest.java
index 7ef5d93..c5227c6 100644
--- a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilterTest.java
+++ b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagFilterTest.java
@@ -117,7 +117,7 @@ public class TagFilterTest {
 
 		List<EntityContainer> expectedResult = Arrays.asList(amenityNodeContainer, residentialWayContainer);
 		assertTrue(entityInspector.getProcessedEntities().equals(expectedResult));
-		tagFilter.release();
+		tagFilter.close();
 	}
 
 
@@ -140,7 +140,7 @@ public class TagFilterTest {
 
 		List<EntityContainer> expectedResult = Arrays.asList(amenityNodeContainer, residentialWayContainer);
 		assertTrue(entityInspector.getProcessedEntities().equals(expectedResult));
-		tagFilter.release();
+		tagFilter.close();
 	}
 
 
@@ -162,7 +162,7 @@ public class TagFilterTest {
 
 		List<EntityContainer> expectedResult = Arrays.asList(amenityNodeContainer, residentialWayContainer);
 		assertTrue(entityInspector.getProcessedEntities().equals(expectedResult));
-		tagFilter.release();
+		tagFilter.close();
 	}
 
 }
diff --git a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemoverTest.java b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemoverTest.java
index cf3e9e4..f1a1f7b 100644
--- a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemoverTest.java
+++ b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/TagRemoverTest.java
@@ -34,7 +34,7 @@ public class TagRemoverTest extends AbstractDataTest {
 		
 		// Remove all created_by tags.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -68,7 +68,7 @@ public class TagRemoverTest extends AbstractDataTest {
 		
 		// Remove all created_by tags.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
diff --git a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilterTest.java b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilterTest.java
index 51e4160..957554c 100644
--- a/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilterTest.java
+++ b/osmosis-tagfilter/src/test/java/org/openstreetmap/osmosis/tagfilter/v0_6/WayKeyValueFilterTest.java
@@ -51,7 +51,7 @@ public class WayKeyValueFilterTest extends AbstractDataTest {
 		
 		// filter by key-value pairs
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",					
 				"--read-xml-0.6",
 				inputFile.getPath(),
diff --git a/osmosis-tagtransform/src/main/java/org/openstreetmap/osmosis/tagtransform/impl/TransformHelper.java b/osmosis-tagtransform/src/main/java/org/openstreetmap/osmosis/tagtransform/impl/TransformHelper.java
index ba1ed1c..9902788 100644
--- a/osmosis-tagtransform/src/main/java/org/openstreetmap/osmosis/tagtransform/impl/TransformHelper.java
+++ b/osmosis-tagtransform/src/main/java/org/openstreetmap/osmosis/tagtransform/impl/TransformHelper.java
@@ -98,8 +98,8 @@ public abstract class TransformHelper<T extends Task & Initializable> implements
 
 
 	@Override
-	public void release() {
-		sink.release();
+	public void close() {
+		sink.close();
 	}
 
 
diff --git a/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkChangeInspector.java b/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkChangeInspector.java
index a67bee3..7dd5ee4 100644
--- a/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkChangeInspector.java
+++ b/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkChangeInspector.java
@@ -35,7 +35,7 @@ public class SinkChangeInspector implements ChangeSink {
 	}
 
 	@Override
-	public void release() {
+	public void close() {
 		// Nothing to do here
 	}
 
diff --git a/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java b/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java
index 616ebc1..c117671 100644
--- a/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java
+++ b/osmosis-testutil/src/main/java/org/openstreetmap/osmosis/testutil/v0_6/SinkEntityInspector.java
@@ -60,7 +60,7 @@ public class SinkEntityInspector implements Sink {
 	 * {@inheritDoc}
 	 */
 	@Override
-	public void release() {
+	public void close() {
 		// Nothing to do here
 	}
 
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/common/BaseXmlWriter.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/common/BaseXmlWriter.java
index 960900f..8010cc2 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/common/BaseXmlWriter.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/common/BaseXmlWriter.java
@@ -212,7 +212,7 @@ public abstract class BaseXmlWriter {
 	/**
 	 * Cleans up any open file handles.
 	 */
-	public void release() {
+	public void close() {
 		try {
 			if (closeRequired) {
 				try {
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/FastXmlReader.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/FastXmlReader.java
index d32aadb..5f6fe15 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/FastXmlReader.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/FastXmlReader.java
@@ -101,7 +101,7 @@ public class FastXmlReader implements RunnableSource {
 			} catch (Exception e) {
 				throw new OsmosisRuntimeException("Unable to read XML file " + file + ".", e);
 			} finally {
-				sink.release();
+				sink.close();
 				
 				if (inputStream != null) {
 					try {
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeReader.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeReader.java
index 0139da7..faecb05 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeReader.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeReader.java
@@ -104,7 +104,7 @@ public class XmlChangeReader implements RunnableChangeSource {
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read XML file " + file + ".", e);
 		} finally {
-			changeSink.release();
+			changeSink.close();
 
 			if (inputStream != null) {
 				try {
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeUploader.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeUploader.java
index 37b403b..8251818 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeUploader.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeUploader.java
@@ -305,7 +305,7 @@ public class XmlChangeUploader implements ChangeSink {
      * {@inheritDoc}
      */
     @Override
-    public final void release() {
+    public final void close() {
         if (this.myChangesetNumber != -1) {
             try {
                 LOG.fine("release() called");
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlDownloader.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlDownloader.java
index 2a463ba..d744e6b 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlDownloader.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlDownloader.java
@@ -211,7 +211,7 @@ public class XmlDownloader implements RunnableSource {
         } catch (IOException e) {
             throw new OsmosisRuntimeException("Unable to read XML.", e);
         } finally {
-            mySink.release();
+            mySink.close();
 
             cleanup();
         }
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlReader.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlReader.java
index 3e93fa5..a333901 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlReader.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlReader.java
@@ -104,7 +104,7 @@ public class XmlReader implements RunnableSource {
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("Unable to read XML file " + file + ".", e);
 		} finally {
-			sink.release();
+			sink.close();
 			
 			if (inputStream != null) {
 				try {
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/ChangeSourceElementProcessor.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/ChangeSourceElementProcessor.java
index 6aeda0a..e34e996 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/ChangeSourceElementProcessor.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/ChangeSourceElementProcessor.java
@@ -123,7 +123,7 @@ public class ChangeSourceElementProcessor extends BaseElementProcessor {
 		 * @param action
 		 *            The action to apply to all data received.
 		 */
-		public ChangeSinkAdapter(ChangeSink changeSink, ChangeAction action) {
+		ChangeSinkAdapter(ChangeSink changeSink, ChangeAction action) {
 			this.changeSink = changeSink;
 			this.action = action;
 		}
@@ -156,8 +156,8 @@ public class ChangeSourceElementProcessor extends BaseElementProcessor {
 		/**
 		 * {@inheritDoc}
 		 */
-		public void release() {
-			changeSink.release();
+		public void close() {
+			changeSink.close();
 		}
 	}
 }
diff --git a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmWriter.java b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmWriter.java
index 2efbccc..680efd4 100644
--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmWriter.java
+++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmWriter.java
@@ -119,7 +119,7 @@ public class OsmWriter extends ElementWriter {
 		 * @param indentLevel
 		 *            The indent level of the sub-elements.
 		 */
-		public SubElementWriter(int indentLevel, boolean legacyBound) {
+		SubElementWriter(int indentLevel, boolean legacyBound) {
 			nodeWriter = new NodeWriter("node", indentLevel);
 			wayWriter = new WayWriter("way", indentLevel);
 			relationWriter = new RelationWriter("relation", indentLevel);
diff --git a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/common/ElementWriterTest.java b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/common/ElementWriterTest.java
index 7809ae2..c9c098d 100644
--- a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/common/ElementWriterTest.java
+++ b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/common/ElementWriterTest.java
@@ -45,7 +45,7 @@ public class ElementWriterTest {
 	
 	
 	private static class MyElementWriter extends ElementWriter {
-		public MyElementWriter() {
+		MyElementWriter() {
 			super("testElement", 1);
 		}
 		
diff --git a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/XmlReaderWriterTest.java b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/XmlReaderWriterTest.java
index 8265156..7654194 100644
--- a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/XmlReaderWriterTest.java
+++ b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/XmlReaderWriterTest.java
@@ -34,7 +34,7 @@ public class XmlReaderWriterTest extends AbstractDataTest {
 		
 		// Run the pipeline.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
@@ -71,7 +71,7 @@ public class XmlReaderWriterTest extends AbstractDataTest {
 		
 		// Run the pipeline.
 		Osmosis.run(
-			new String [] {
+			new String[] {
 				"-q",
 				"--read-xml-0.6",
 				inputFile.getPath(),
diff --git a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/NodeWriterTest.java b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/NodeWriterTest.java
index c63e86c..066501b 100644
--- a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/NodeWriterTest.java
+++ b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/NodeWriterTest.java
@@ -101,7 +101,7 @@ public class NodeWriterTest {
 			e.printStackTrace();
 			fail("IOException");
 		}
-		String [] strArray = testWriter.toString().split("\\n", 3);
+		String[] strArray = testWriter.toString().split("\\n", 3);
 		assertTrue("Node opening element does not match.", strArray[0].matches(nodeOpeningMatch));
 		assertTrue("Node tag does not match.", strArray[1].matches(nodeTagMatch));
 		assertTrue("Node closing element does not match.", strArray[2].matches(nodeClosingMatch));
@@ -161,7 +161,7 @@ public class NodeWriterTest {
 	        + "lat=['\"]20.1234568['\"]\\s*"
 	        + "lon=['\"]-21.9876543['\"]\\s*"
 	        + ">\\s*";
-		String [] strArray = testWriter.toString().split("\\n", 3);
+		String[] strArray = testWriter.toString().split("\\n", 3);
 		assertTrue("Node opening element does not match.", strArray[0].matches(nodeOpeningNoUserMatch));
 		assertTrue("Node tag does not match.", strArray[1].matches(nodeTagMatch));
 		assertTrue("Node closing element does not match.", strArray[2].matches(nodeClosingMatch));
diff --git a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmHandlerTest.java b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmHandlerTest.java
index 157a2d1..4116282 100644
--- a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmHandlerTest.java
+++ b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/OsmHandlerTest.java
@@ -57,26 +57,14 @@ public class OsmHandlerTest {
 
 
 	private void parseString(String input) {
-		InputStream inputStream = null;
-		try {
-			inputStream = new ByteArrayInputStream(input.getBytes("UTF-8"));
+		try (InputStream inputStream = new ByteArrayInputStream(input.getBytes("UTF-8"))) {
 			parser.parse(inputStream, new OsmHandler(entityInspector, true));
 		} catch (UnsupportedEncodingException e) {
 			throw new OsmosisRuntimeException("String encoding exception", e);
-		} catch (SAXException e) {
-			throw new OsmosisRuntimeException("Parse exception", e);
 		} catch (IOException e) {
 			throw new OsmosisRuntimeException("IOException", e);
-		} finally {
-			try {
-				if (inputStream != null) {
-					inputStream.close();
-				}
-			} catch (IOException e) {
-				throw new OsmosisRuntimeException("IOException", e);
-			} finally {
-				inputStream = null;
-			}
+		} catch (SAXException e) {
+			throw new OsmosisRuntimeException("Parse exception", e);
 		}
 	}
 
diff --git a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/RelationWriterTest.java b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/RelationWriterTest.java
index 3d6afe4..37a42ea 100644
--- a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/RelationWriterTest.java
+++ b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/RelationWriterTest.java
@@ -114,7 +114,7 @@ public class RelationWriterTest {
 			e.printStackTrace();
 			fail("IOException");
 		}
-		String [] strArray = testWriter.toString().split("\\n", 6);
+		String[] strArray = testWriter.toString().split("\\n", 6);
 		assertTrue("Relation opening element does not match.", strArray[0].matches(relationOpeningMatch));
 		assertTrue("Relation member node does not match.", strArray[1].matches(nodeMemberMatch));
 		assertTrue("Relation member way does not match.", strArray[2].matches(wayMemberMatch));
@@ -148,7 +148,7 @@ public class RelationWriterTest {
 				+ "version=['\"]2['\"]\\s*"
 				+ "timestamp=['\"]2013-10-07T10:24:31Z?['\"]\\s*"
 				+ ">\\s*";
-		String [] strArray = testWriter.toString().split("\\n", 6);
+		String[] strArray = testWriter.toString().split("\\n", 6);
 		assertTrue(strArray[0].matches(relationOpeningNoUserMatch));
 		assertTrue(strArray[1].matches(nodeMemberMatch));
 		assertTrue(strArray[2].matches(wayMemberMatch));
@@ -176,7 +176,7 @@ public class RelationWriterTest {
 			e.printStackTrace();
 			fail("IOException");
 		}
-		String [] strArray = testWriter.toString().split("\\n", 5);
+		String[] strArray = testWriter.toString().split("\\n", 5);
 		assertTrue(strArray[0].matches(relationOpeningMatch));
 		assertTrue(strArray[1].matches(nodeMemberMatch));
 		assertTrue(strArray[2].matches(wayMemberMatch));
diff --git a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/WayWriterTest.java b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/WayWriterTest.java
index 88eca81..6c206cf 100644
--- a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/WayWriterTest.java
+++ b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/v0_6/impl/WayWriterTest.java
@@ -100,7 +100,7 @@ public class WayWriterTest {
 			e.printStackTrace();
 			fail("IOException");
 		}
-		String [] strArray = testWriter.toString().split("\\n", 5);
+		String[] strArray = testWriter.toString().split("\\n", 5);
 		assertTrue("Way opening element does not match.", strArray[0].matches(wayOpeningMatch));
 		assertTrue("Way node 1 does not match.", strArray[1].matches(wayNode1Match));
 		assertTrue("Way node 2 does not match.", strArray[2].matches(wayNode2Match));
@@ -132,7 +132,7 @@ public class WayWriterTest {
 	        + "version=['\"]2['\"]\\s*"
 			+ "timestamp=['\"]2013-10-07T10:24:31Z?['\"]\\s*"
 	        + ">\\s*";
-		String [] strArray = testWriter.toString().split("\\n", 5);
+		String[] strArray = testWriter.toString().split("\\n", 5);
 		assertTrue("Way opening element does not match.", strArray[0].matches(wayOpeningNoUserMatch));
 		assertTrue("Way node 1 does not match.", strArray[1].matches(wayNode1Match));
 		assertTrue("Way node 2 does not match.", strArray[2].matches(wayNode2Match));
@@ -158,7 +158,7 @@ public class WayWriterTest {
 			e.printStackTrace();
 			fail("IOException");
 		}
-		String [] strArray = testWriter.toString().split("\\n", 4);
+		String[] strArray = testWriter.toString().split("\\n", 4);
 		assertTrue("Way opening element does not match.", strArray[0].matches(wayOpeningMatch));
 		assertTrue("Way node 1 does not match.", strArray[1].matches(wayNode1Match));
 		assertTrue("Way node 2 does not match.", strArray[2].matches(wayNode2Match));
diff --git a/package/changes.txt b/package/changes.txt
index 3de6d38..44cccaa 100644
--- a/package/changes.txt
+++ b/package/changes.txt
@@ -1,3 +1,14 @@
+0.46
+Require Java 8 as a minimum.
+Leverage Java 7 Autocloseable functionality and remove Releasable interface.
+Apply minor code cleanups contributed by devfactory.com.
+Add tests for pgsimple tasks.
+Introduce docker-based build environment.
+Introduce Travis CI testing.
+Add support for reading protobuf from InputStream.  Useful when using Osmosis as a library.
+Upgrade to protobuf 3.
+Make compression optional in EntitySorter.
+
 0.45
 Add postgresSchema option to pgsnapshot tasks.
 Verify XML parser on startup to verify support for multi-char unicode characters.
@@ -230,11 +241,11 @@ Removed the old postgresql tasks.
 Removed "simple" from the names of the simple pgsql tasks.
 Added plugin support allowing new tasks in external jar files to be registered with osmosis.
 Added command line checks to ensure all task and option arguments are recognised, any misspelt arguments will now raise an error.
-Removed all static methods from the task registrar and task manager factory classes to avoid global data and simplify testing. 
+Removed all static methods from the task registrar and task manager factory classes to avoid global data and simplify testing.
 Added the --node-key and --node-key-value tasks.
 
 0.28
-Added a maximum file download count feature to the change downloader to limit processing overhead when synchronising long time intervals. 
+Added a maximum file download count feature to the change downloader to limit processing overhead when synchronising long time intervals.
 Fixed a major error in the TaskRegistrar from 0.27 where multiple tasks had the same name preventing osmosis from launching.
 
 0.27
@@ -242,7 +253,7 @@ Added change downloader tasks providing the basis for automatic synchronisation
 
 0.26
 Removed the bdb dataset implementation.
-Fixed an incorrect constant bug in the mysql tile calculator causing incorrect tile values to be generated.  
+Fixed an incorrect constant bug in the mysql tile calculator causing incorrect tile values to be generated.
 
 0.25
 Added a new osmosis-extract-mysql application for extracting regular changesets from mysql.
diff --git a/settings.gradle b/settings.gradle
index c3cad8f..1cc0205 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,5 +1,4 @@
 include 'build-support'
-include 'db-server'
 include 'osmosis-areafilter'
 include 'osmosis-apidb'
 include 'osmosis-core'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmosis.git



More information about the Pkg-grass-devel mailing list