@Test @Ignore public void happy_validate_or_throw_for_write() throws Exception { assertFalse(Const.validateHeaderOrThrowForWrite(hdr)); hdr.version_number = VERSION - 1; assertTrue(Const.validateHeaderOrThrowForWrite(hdr)); }
public static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr) throws IOException { if (!validateHeader(hdr).isAcceptable() || !isUpgradable(hdr.version_number)) throw new IOException("Can't read this file, header validation yields " + validateHeader(hdr).name() + "(" + versionStr(hdr.version_number) + ")"); return needsUpgrade(hdr.version_number); }
Const { public static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr) throws IOException { if (!validateHeader(hdr).isAcceptable() || !isUpgradable(hdr.version_number)) throw new IOException("Can't read this file, header validation yields " + validateHeader(hdr).name() + "(" + versionStr(hdr.version_number) + ")"); return needsUpgrade(hdr.version_number); } }
Const { public static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr) throws IOException { if (!validateHeader(hdr).isAcceptable() || !isUpgradable(hdr.version_number)) throw new IOException("Can't read this file, header validation yields " + validateHeader(hdr).name() + "(" + versionStr(hdr.version_number) + ")"); return needsUpgrade(hdr.version_number); } private  Const(); }
Const { public static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr) throws IOException { if (!validateHeader(hdr).isAcceptable() || !isUpgradable(hdr.version_number)) throw new IOException("Can't read this file, header validation yields " + validateHeader(hdr).name() + "(" + versionStr(hdr.version_number) + ")"); return needsUpgrade(hdr.version_number); } private  Const(); static int version_from_majmin(short maj, short min); static short version_major(int ver); static short version_minor(int ver); static boolean isUpgradable(short maj, short min); static boolean isUpgradable(int version); static boolean needsUpgrade(short maj, short min); static boolean needsUpgrade(int version); static Validation validateHeader(tsfile_mimeheader hdr); static int validateHeaderOrThrow(tsfile_mimeheader hdr); static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr); static int validateHeaderOrThrow(XdrDecodingStream decoder); static boolean validateHeaderOrThrowForWrite(XdrDecodingStream decoder); static void writeMimeHeader(XdrEncodingStream encoder, short major, short minor); static void writeMimeHeader(XdrEncodingStream encoder); }
Const { public static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr) throws IOException { if (!validateHeader(hdr).isAcceptable() || !isUpgradable(hdr.version_number)) throw new IOException("Can't read this file, header validation yields " + validateHeader(hdr).name() + "(" + versionStr(hdr.version_number) + ")"); return needsUpgrade(hdr.version_number); } private  Const(); static int version_from_majmin(short maj, short min); static short version_major(int ver); static short version_minor(int ver); static boolean isUpgradable(short maj, short min); static boolean isUpgradable(int version); static boolean needsUpgrade(short maj, short min); static boolean needsUpgrade(int version); static Validation validateHeader(tsfile_mimeheader hdr); static int validateHeaderOrThrow(tsfile_mimeheader hdr); static boolean validateHeaderOrThrowForWrite(tsfile_mimeheader hdr); static int validateHeaderOrThrow(XdrDecodingStream decoder); static boolean validateHeaderOrThrowForWrite(XdrDecodingStream decoder); static void writeMimeHeader(XdrEncodingStream encoder, short major, short minor); static void writeMimeHeader(XdrEncodingStream encoder); static byte[] MAGIC; static final int MIME_HEADER_LEN; static final short MAJOR; static final short MINOR; }