Updated to worldwind release 20070817
[worldwind-tracker.git] / gov / nasa / worldwind / formats / nitfs / UserDefinedImageSubheader.java
blob225b6c3c42726c504ec519528e70fac007a51c66
1 package gov.nasa.worldwind.formats.nitfs;
3 import gov.nasa.worldwind.formats.rpf.RPFFrameFileComponents;
4 import gov.nasa.worldwind.util.StringUtil;
5 /*
6 Copyright (C) 2001, 2007 United States Government
7 as represented by the Administrator of the
8 National Aeronautics and Space Administration.
9 All Rights Reserved.
12 /**
13 * @author Lado Garakanidze
14 * @version $Id: UserDefinedImageSubheader Mar 31, 2007 9:42:33 PM
16 public class UserDefinedImageSubheader
18 public short getOverflow()
20 return this.overflow;
23 public String getTag()
25 return this.tag;
28 public int getDataLength()
30 return this.dataLength;
33 public RPFFrameFileComponents getRPFFrameFileComponents()
35 return this.rpfFrameFileComponents;
38 private RPFFrameFileComponents rpfFrameFileComponents = null;
40 private short overflow;
41 private String tag;
42 private int dataLength;
44 public UserDefinedImageSubheader(java.nio.ByteBuffer buffer) throws NITFSRuntimeException {
45 this.overflow = NITFSUtil.getShortNumeric(buffer, 3);
46 this.tag = NITFSUtil.getString(buffer, 6);
47 this.dataLength = NITFSUtil.getShortNumeric(buffer, 5);
49 if(0 < this.dataLength)
51 if(StringUtil.Equals(tag, RPFFrameFileComponents.DATA_TAG))
52 this.rpfFrameFileComponents = new RPFFrameFileComponents(buffer);
53 else
54 throw new NITFSRuntimeException("NITFSReader.UnknownOrUnsupportedUserDefinedImageSubheader");