Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.clustermate.service.metrics;
 
 
 
 public final class SerializedMetrics
 {
    public final long created;
    private final JsonFactory jsonFactory;
    
    private final byte[] serialized;
    private volatile byte[] indented;
    
    public SerializedMetrics(JsonFactory jflong crbyte[] data) {
         = jf;
         = cr;
         = data;
    }
    public byte[] getRaw() {
        return ;
    }
    public byte[] getIndented() throws IOException
    {
        byte[] json = ;
        if (json == null) {
             = json = _indent();
        }
        return json;
    }
    private byte[] _indent(byte[] rawJsonthrows IOException
    {
        ByteArrayOutputStream out = new ByteArrayOutputStream((rawJson.length * 3) / 2);
        JsonParser jp = .createParser(rawJson);
        JsonGenerator jg = .createGenerator(out);
        jg.useDefaultPrettyPrinter();
        while (jp.nextToken() != null) {
            jg.copyCurrentEvent(jp);
        }
        jp.close();
        jg.close();
        return out.toByteArray();
    }
New to GrepCode? Check out our FAQ X