Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.clustermate.service.state;
 
 
 
public class JacksonBasedConverter<T>
    extends RawEntryConverter<T>
    protected final ObjectReader _reader;
    protected final ObjectWriter _writer;
    public JacksonBasedConverter(ObjectMapper mapperClass<T> type)
    {
         = mapper.reader(type);
         = mapper.writerWithType(type);
    }
    
    @Override
    public T fromRaw(byte[] rawint offsetint length)
            throws IOException {
        return .readValue(rawoffsetlength);
    }
    @Override
    public byte[] toRaw(T valuethrows IOException {
        return .writeValueAsBytes(value);
    }
New to GrepCode? Check out our FAQ X