an implementation to  UniformQuantization in java