001/*
002 * Syncany, www.syncany.org
003 * Copyright (C) 2011-2016 Philipp C. Heckel <philipp.heckel@gmail.com> 
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation, either version 3 of the License, or
008 * (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018package org.syncany.chunk;
019
020/**
021 * A chunk represents a certain part of a file. It is created during the
022 * deduplication process by a {@link Chunker}. 
023 * 
024 * @author Philipp C. Heckel (philipp.heckel@gmail.com)
025 */
026public class Chunk {
027    private byte[] checksum;
028    private byte[] contents;
029    private int size;
030    private byte[] fileChecksum;
031
032    /*package*/ Chunk(byte[] checksum, byte[] contents, int size, byte[] fileChecksum) {
033        this.checksum = checksum;
034        this.contents = contents;
035        this.size = size;
036        this.fileChecksum = fileChecksum;
037    }
038
039    public byte[] getChecksum() {
040        return checksum;
041    }
042
043    public byte[] getContent() {
044        return contents;
045    }
046
047    public byte[] getFileChecksum() {
048        return fileChecksum;
049    }
050
051    public int getSize() {
052        return size;
053    }                
054}