@Test
public void test() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
EncoderFactory factory = EncoderFactory.get();
Encoder e = factory.validatingEncoder(schema,
factory.binaryEncoder(baos, null));
ResolvingGrammarGenerator.encode(e, schema, data);
e.flush();
}