public boolean isValidFile(RandomAccessFile raf) throws IOException { raf.seek(0); if (!readAndTest(raf, NcStream.MAGIC_START)) return false; // must start with these 4 bytes byte[] b = new byte[4]; raf.readFully(b); return test(b, NcStream.MAGIC_HEADER) || test(b, NcStream.MAGIC_DATA); // immed followed by one of these }
public boolean isValidFile(RandomAccessFile raf) throws IOException { raf.seek(0); if (!readAndTest(raf, NcStream.MAGIC_START)) return false; // must start with these 4 bytes byte[] b = new byte[4]; raf.read(b); return test(b, NcStream.MAGIC_HEADER) || test(b, NcStream.MAGIC_DATA); // immed followed by one of these }
public boolean isValidFile(RandomAccessFile raf) throws IOException { raf.seek(0); if (!readAndTest(raf, NcStream.MAGIC_START)) return false; // must start with these 4 bytes byte[] b = new byte[4]; raf.readFully(b); return test(b, NcStream.MAGIC_HEADER) || test(b, NcStream.MAGIC_DATA); // immed followed by one of these }
long pos = raf.getFilePointer(); if (!readAndTest(raf, NcStream.MAGIC_START)) { if (ncm != null) { ncm.add(new NcsMess(pos, 0, "MAGIC_START missing - abort")); if (!readAndTest(raf, NcStream.MAGIC_HEADER)) { if (ncm != null) { ncm.add(new NcsMess(pos, 0, "MAGIC_HEADER missing - abort"));
long pos = raf.getFilePointer(); if (!readAndTest(raf, NcStream.MAGIC_START)) { if (ncm != null) { ncm.add(new NcsMess(pos, 0, "MAGIC_START missing - abort")); if (!readAndTest(raf, NcStream.MAGIC_HEADER)) { if (ncm != null) { ncm.add(new NcsMess(pos, 0, "MAGIC_HEADER missing - abort"));
long pos = raf.getFilePointer(); if (!readAndTest(raf, NcStream.MAGIC_START)) { if (ncm != null) { ncm.add(new NcsMess(pos, 0, "MAGIC_START missing - abort")); if (!readAndTest(raf, NcStream.MAGIC_HEADER)) { if (ncm != null) { ncm.add(new NcsMess(pos, 0, "MAGIC_HEADER missing - abort"));