1 package gov
.nasa
.worldwind
.formats
.nitfs
;
3 Copyright (C) 2001, 2007 United States Government
4 as represented by the Administrator of the
5 National Aeronautics and Space Administration.
10 * @author Lado Garakanidze
11 * @version $Id: NitfsSegment.java Mar 21, 2007 5:44:57 PM lado
13 public class NitfsSegment
15 protected java
.nio
.ByteBuffer buffer
;
16 protected NitfsSegmentType segmentType
;
17 protected int savedBufferOffset
;
19 protected int headerStartOffset
;
20 protected int headerLength
;
21 protected int dataStartOffset
;
22 protected int dataLength
;
24 public NitfsSegment(NitfsSegmentType segmentType
, java
.nio
.ByteBuffer buffer
,
25 int headerStartOffset
, int headerLength
, int dataStartOffset
, int dataLength
)
28 this.segmentType
= segmentType
;
29 this.headerStartOffset
= headerStartOffset
;
30 this.headerLength
= headerLength
;
31 this.dataStartOffset
= dataStartOffset
;
32 this.dataLength
= dataLength
;
33 this.savedBufferOffset
= buffer
.position();
36 protected void restoreBufferPosition()
38 this.buffer
.position(this.savedBufferOffset
);