1/*
2 * Copyright 2008 CoreMedia AG, Hamburg
3 *
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.coremedia.iso.boxes;
18
19import com.coremedia.iso.IsoTypeReader;
20import com.coremedia.iso.IsoTypeWriter;
21import com.googlecode.mp4parser.AbstractFullBox;
22
23import java.nio.ByteBuffer;
24
25/**
26 *
27 */
28public class RecordingYearBox extends AbstractFullBox {
29    public static final String TYPE = "yrrc";
30
31    int recordingYear;
32
33    public RecordingYearBox() {
34        super(TYPE);
35    }
36
37
38    protected long getContentSize() {
39        return 6;
40    }
41
42    public int getRecordingYear() {
43        return recordingYear;
44    }
45
46    public void setRecordingYear(int recordingYear) {
47        this.recordingYear = recordingYear;
48    }
49
50
51    @Override
52    public void _parseDetails(ByteBuffer content) {
53        parseVersionAndFlags(content);
54        recordingYear = IsoTypeReader.readUInt16(content);
55    }
56
57    @Override
58    protected void getContent(ByteBuffer byteBuffer) {
59        writeVersionAndFlags(byteBuffer);
60        IsoTypeWriter.writeUInt16(byteBuffer, recordingYear);
61    }
62
63}
64