Package crosby.binary

Class BinarySerializer

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class BinarySerializer
    extends java.lang.Object
    implements java.io.Closeable, java.io.Flushable
    Generic serializer common code Serialize a set of blobs and process them. Subclasses implement handlers for different API's (osmosis, mkgmap, splitter, etc.) All data is converted into PrimGroupWriterInterface objects, which are then ordered to process their data at the appropriate time.
    • Field Detail

      • batch_limit

        protected int batch_limit
      • granularity

        protected int granularity
      • date_granularity

        protected int date_granularity
      • omit_metadata

        protected boolean omit_metadata
      • batch_size

        protected int batch_size
        How many primitives have been seen in this batch
      • total_entities

        protected int total_entities
      • debug_bytes

        long debug_bytes
    • Method Detail

      • configGranularity

        public void configGranularity​(int granularity)
        Set the granularity (precision of lat/lon, measured in unites of nanodegrees.
      • configOmit

        public void configOmit​(boolean omit_metadata)
        Set whether metadata is to be omitted
      • configBatchLimit

        public void configBatchLimit​(int batch_limit)
        Configure the maximum number of entities in a batch
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • processBatch

        public void processBatch()
      • mapRawDegrees

        public long mapRawDegrees​(double degrees)
        Convert from a degrees represented as a double into the serialized offset in nanodegrees..
      • mapDegrees

        public int mapDegrees​(double degrees)
        Convert from a degrees represented as a double into the serialized offset.