001/**
002 * Copyright 2015 DuraSpace, Inc.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.modeshape.jcr.value.binary.infinispan;
017
018/**
019 * Get access to the important properties in the Modeshape Binary Metadata
020 * @author cabeer
021 */
022public class ChunkBinaryMetadata {
023    private int chunkSize;
024    private long length;
025
026    /**
027     * Wrap a Metadata object
028     * @param metadata the metadata
029     */
030    public ChunkBinaryMetadata(final Metadata metadata) {
031        chunkSize = metadata.getChunkSize();
032        length = metadata.getLength();
033    }
034
035    /**
036     * Get the content length
037     * @return the content length
038     */
039    public long getLength() {
040        return length;
041    }
042
043    /**
044     * Get the size of the binary's chunks
045     * @return the size of the binary's chunks
046     */
047    public int getChunkSize() {
048        return chunkSize;
049    }
050}