/** * decrypt a BSON string * @param datas : BSON formated String * @return JSON formated String */ private static String decryptBSON(String datas){ String[] tab = datas.split("[a-zA-Z]"); byte[] array = new byte[tab.length]; for(int i =0; i<tab.length; i++){ array[i] = Byte.valueOf(tab[i]); } BSONDecoder decoder = new BasicBSONDecoder(); BasicBSONObject obj = (BasicBSONObject) decoder.readObject(array); System.out.println(obj); return obj.toString(); }
public static BSONDecoder decoder() { return _staticDecoder.get(); }
@Override protected BSONDecoder initialValue() { return new BasicBSONDecoder(); }