package com.jscape.inet.http.protocol.marshaling;

import static com.jscape.util.Parameters.assertNotNull;

/**
 * @author Alex Usun
 */
public class Chunk {
    
    public final byte[] data;
    public final int offset;
    public final int length;
    public final String[] extensions;
    
    public static Chunk empty(String... extensions) {
        return new Chunk(new byte[0], 0, 0, extensions);
    }
    
    public Chunk(byte[] data, int offset, int length, String... extensions) {
        assertNotNull(data);
        this.data = data;
        
        this.offset = offset;
        this.length = length;
        
        assertNotNull(extensions);
        this.extensions = extensions;
    }
    
    
}
