view src/org/dancres/blitz/entry/FixedOIDs.java @ 27:511648fa4d64 Version 2.1

Version to 2.1
author Dan Creswell <dan.creswell@gmail.com>
date Mon, 04 Jan 2010 13:00:40 +0000
parents 3dc0c5604566
children
line wrap: on
line source

package org.dancres.blitz.entry;

import org.dancres.util.BytePacker;

/**
   Various fixed OIDs are used to store meta data in the registry associated
   with a particular type.  This class encapsulates all the knowledge of what
   OIDs are used to store which bits of information.
 */
class FixedOIDs {
    private static final long INDEXES_OID = 0;
    private static final long SUBTYPES_OID = 1;

    static final byte[] INDEXES_KEY =
        keyFor(INDEXES_OID);

    static final byte[] SUBTYPES_KEY =
        keyFor(SUBTYPES_OID);

    static byte[] keyFor(long anId) {
        byte[] myKey = new byte[8];

        BytePacker myPacker = BytePacker.getMSBPacker(myKey);
        myPacker.putLong(anId, 0);

        return myKey;
    }

}