Search in sources :

Example 1 with ByteArraySerializerDeserializer

use of org.apache.hyracks.dataflow.common.data.marshalling.ByteArraySerializerDeserializer in project asterixdb by apache.

the class ByteArrayHexParserFactory method createValueParser.

@Override
public IValueParser createValueParser() {
    return new IValueParser() {

        HexParser parser = new HexParser();

        ByteArraySerializerDeserializer serializer = ByteArraySerializerDeserializer.INSTANCE;

        @Override
        public void parse(char[] input, int start, int length, DataOutput out) throws HyracksDataException {
            try {
                parser.generateByteArrayFromHexString(input, start, length);
                serializer.serialize(parser.getByteArray(), 0, parser.getLength(), out);
            } catch (IOException e) {
                throw new HyracksDataException(e);
            }
        }
    };
}
Also used : DataOutput(java.io.DataOutput) ByteArraySerializerDeserializer(org.apache.hyracks.dataflow.common.data.marshalling.ByteArraySerializerDeserializer) HexParser(org.apache.hyracks.util.bytes.HexParser) IOException(java.io.IOException) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException)

Aggregations

DataOutput (java.io.DataOutput)1 IOException (java.io.IOException)1 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1 ByteArraySerializerDeserializer (org.apache.hyracks.dataflow.common.data.marshalling.ByteArraySerializerDeserializer)1 HexParser (org.apache.hyracks.util.bytes.HexParser)1