private float getDataBlockValue1(RandomAccessFile raf, short offset, int skip) throws IOException { long off = offset + message_offset + MESSAGE_HEADER_SIZE; raf.seek(off); raf.skipBytes(skip); return raf.readFloat(); }
private float getDataBlockValue1(RandomAccessFile raf, short offset, int skip) throws IOException { long off = offset + message_offset + MESSAGE_HEADER_SIZE; raf.seek(off); raf.skipBytes(skip); return raf.readFloat(); }
private short getDataBlockValue(RandomAccessFile raf, short offset, int skip) throws IOException { long off = offset + message_offset + MESSAGE_HEADER_SIZE; raf.seek(off); raf.skipBytes(skip); return raf.readShort(); }
private short getDataBlockValue(RandomAccessFile raf, short offset, int skip) throws IOException { long off = offset + message_offset + MESSAGE_HEADER_SIZE; raf.seek(off); raf.skipBytes(skip); return raf.readShort(); }
void read() throws IOException { version = raf.readByte(); raf.skipBytes(3); // skip byte secs = raf.readInt(); }
void read() throws IOException { byte version = raf.readByte(); byte nfilters = raf.readByte(); if (version == 1) raf.skipBytes(6); filters = new Filter[nfilters]; for (int i = 0; i < nfilters; i++) filters[i] = new Filter(version); if (debug1) debugOut.println(" MessageFilter version=" + version + this); }
void read() throws IOException { byte version = raf.readByte(); byte nfilters = raf.readByte(); if (version == 1) raf.skipBytes(6); filters = new Filter[nfilters]; for (int i = 0; i < nfilters; i++) filters[i] = new Filter(version); if (debug1) debugOut.println(" MessageFilter version=" + version + this); }
static public boolean isValidFile(RandomAccessFile raf) throws IOException { raf.seek(0); if (!raf.searchForward(matcher, 8000)) return false; // must find "GRIB" in first 8k raf.skipBytes(4); // Read Section 0 Indicator Section to get Edition number Grib2IndicatorSection is = new Grib2IndicatorSection(raf); // section 0 if (is.getGribEdition() != 1 && is.getGribEdition() != 2) return false; if (is.getGribLength() > raf.length()) return false; return true; }
Object readDoubleArray1D(int offsetInRecord) throws IOException { int elementSizeInBytes = 8; double[] array = new double[header.getNumDataRecords()]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readDouble(array, i, 1); this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes); } return (array); }
Object readFloatArray1D(int offsetInRecord) throws IOException { int elementSizeInBytes = 4; float[] array = new float[header.getNumDataRecords()]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readFloat(array, i, 1); this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes); } return (array); }
Object readFloatArray1D(int offsetInRecord) throws IOException { int elementSizeInBytes = 4; float[] array = new float[header.getNumDataRecords()]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readFloat(array, i, 1); this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes); } return (array); }
Object readFloatArray1D(int offsetInRecord) throws IOException { int elementSizeInBytes = 4; float[] array = new float[header.getNumDataRecords()]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readFloat(array, i, 1); this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes); } return (array); }
Object readIntArray1D(int offsetInRecord) throws IOException { int elementSizeInBytes = 4; int[] array = new int[header.getNumDataRecords()]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readInt(array, i, 1); this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes); } return (array); }
Object readDoubleArray1D(int offsetInRecord) throws IOException { int elementSizeInBytes = 8; double[] array = new double[header.getNumDataRecords()]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readDouble(array, i, 1); this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes); } return (array); }
Object readByteArray2D(int offsetInRecord, int numElementsInRecord) throws IOException { byte[] array = new byte[header.getNumDataRecords() * numElementsInRecord]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readFully(array, i * numElementsInRecord, numElementsInRecord); this.raf.skipBytes(header.getRecordSizeInBytes() - numElementsInRecord); } return (array); }
Object readByteArray2D(int offsetInRecord, int numElementsInRecord) throws IOException { byte[] array = new byte[header.getNumDataRecords() * numElementsInRecord]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.read(array, i * numElementsInRecord, numElementsInRecord); this.raf.skipBytes(header.getRecordSizeInBytes() - numElementsInRecord); } return (array); }
Object readIntArray1D(int offsetInRecord) throws IOException { int elementSizeInBytes = 4; int[] array = new int[header.getNumDataRecords()]; this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord); for (int i = 0; i < header.getNumDataRecords(); i++) { this.raf.readInt(array, i, 1); this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes); } return (array); }
void read() throws IOException { raf.seek(offset); xdim = raf.readInt(); ydim = raf.readInt(); raf.skipBytes(2); nt_ref = raf.readShort(); nelems = raf.readShort(); interlace = raf.readShort(); compress = raf.readShort(); compress_ref = raf.readShort(); }
void read() throws IOException { raf.seek(offset); xdim = raf.readInt(); ydim = raf.readInt(); raf.skipBytes(2); nt_ref = raf.readShort(); nelems = raf.readShort(); interlace = raf.readShort(); compress = raf.readShort(); compress_ref = raf.readShort(); }
protected void read() throws IOException { raf.seek(offset); xdim = raf.readInt(); ydim = raf.readInt(); raf.skipBytes(2); nt_ref = raf.readShort(); nelems = raf.readShort(); interlace = raf.readShort(); compress = raf.readShort(); compress_ref = raf.readShort(); }