File: CompressedCdfRecord.java

package info (click to toggle)
jcdf 1.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 540 kB
  • sloc: java: 5,325; makefile: 163; sh: 98
file content (42 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package uk.ac.bristol.star.cdf.record;

import java.io.IOException;

/**
 * Field data for CDF record of type Compressed CDF Record.
 *
 * @author   Mark Taylor
 * @since    19 Jun 2013
 */
public class CompressedCdfRecord extends Record {

    @CdfField @OffsetField public final long cprOffset;
    @CdfField public final long uSize;
    @CdfField public final int rfuA;
    private final long dataOffset_;

    /**
     * Constructor.
     *
     * @param  plan  basic record information
     */
    public CompressedCdfRecord( RecordPlan plan ) throws IOException {
        super( plan, "CCR", 10 );
        Buf buf = plan.getBuf();
        Pointer ptr = plan.createContentPointer();
        this.cprOffset = buf.readOffset( ptr );
        this.uSize = buf.readOffset( ptr );
        this.rfuA = checkIntValue( buf.readInt( ptr ), 0 );
        dataOffset_ = ptr.get();
    }

    /**
     * Returns the file offset at which the compressed data in
     * this record starts.
     *
     * @return  file offset for start of data field
     */
    public long getDataOffset() {
        return dataOffset_;
    }
}