raf.seek(pos);
// gini header process
byte[] buf = new byte[FY_AWX_PIB_LEN];
int count = raf.read(buf);
EndianByteBuffer byteBuffer = null;
if (count == FY_AWX_PIB_LEN) {
byteBuffer = new EndianByteBuffer(buf);
this.firstHeader.fillHeader(byteBuffer);
// if big endian bytes, fill the head with BIG_ENDIAN instead;
if (this.firstHeader.byteOrder != EndianByteBuffer.LITTLE_ENDIAN) {
byteBuffer = new EndianByteBuffer(buf, EndianByteBuffer.BIG_ENDIAN);
}
} else {
return false;
}
if (!((this.firstHeader.fileName.endsWith(".AWX") || this.firstHeader.fileName.endsWith(".awx"))
&& this.firstHeader.firstHeaderLength == FY_AWX_PIB_LEN)) {
return false;
}
// skip the fills of the first record
// raf.seek(FY_AWX_PIB_LEN + this.firstHeader.fillSectionLength);
buf = new byte[this.firstHeader.secondHeaderLength];
raf.read(buf);
byteBuffer = new EndianByteBuffer(buf, this.firstHeader.byteOrder);
switch (this.firstHeader.typeOfProduct) {
case AwxFileFirstHeader.AWX_PRODUCT_TYPE_UNDEFINED:
throw new UnsupportedDatasetException();
case AwxFileFirstHeader.AWX_PRODUCT_TYPE_GEOSAT_IMAGE:
secondHeader = new AwxFileGeoSatelliteSecondHeader();