code: static Number asNumber(BitStore store) {
  		return new Number() {
  
  			private static final long serialVersionUID = -2906430071162493968L;
  
  			final int size = store.size();
  
  			@Override
  			public byte byteValue() {
  				return (byte) store.getBits(0, Math.min(8, size));
  			}
  
  			@Override
  			public short shortValue() {
  				return (short) store.getBits(0, Math.min(16, size));
  			}
  
  			@Override
  			public int intValue() {
  				return (int) store.getBits(0, Math.min(32, size));
  			}
  
  			@Override
  			public long longValue() {
  				return store.getBits(0, Math.min(64, size));
  			}
  
  			@Override
  			public float floatValue() {
  				return store.toBigInteger().floatValue();
  			}
  
  			@Override
  			public double doubleValue() {
  				return store.toBigInteger().doubleValue();
  			}
  
  		};
  	}
docs: available via default BitStore method