Java Code Examples for javax.imageio.stream.FileImageOutputStream#writeInt()
The following examples show how to use
javax.imageio.stream.FileImageOutputStream#writeInt() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UInt16ParamChoiceTest.java From zserio with BSD 3-Clause "New" or "Revised" License | 6 votes |
private void writeUInt16ParamChoiceToFile(File file, int selector, int value) throws IOException { final FileImageOutputStream stream = new FileImageOutputStream(file); switch (selector) { case 1: stream.writeByte(value); break; case 2: case 3: case 4: stream.writeShort(value); break; case 5: case 6: break; default: stream.writeInt(value); } stream.close(); }
Example 2
Source File: UInt32ParamChoiceTest.java From zserio with BSD 3-Clause "New" or "Revised" License | 6 votes |
private void writeUInt32ParamChoiceToFile(File file, long selector, int value) throws IOException { final FileImageOutputStream stream = new FileImageOutputStream(file); if (selector == 1) { stream.writeByte(value); } else if (selector == 2 || selector == 3 || selector == 4) { stream.writeShort(value); } else if (selector != 5 && selector != 6) { stream.writeInt(value); } stream.close(); }
Example 3
Source File: UInt64ParamChoiceTest.java From zserio with BSD 3-Clause "New" or "Revised" License | 6 votes |
private void writeUInt64ParamChoiceToFile(File file, BigInteger selector, int value) throws IOException { final FileImageOutputStream stream = new FileImageOutputStream(file); if (selector.compareTo(new BigInteger("1")) == 0) stream.writeByte(value); else if (selector.compareTo(new BigInteger("2")) == 0 || selector.compareTo(new BigInteger("3")) == 0 || selector.compareTo(new BigInteger("4")) == 0) stream.writeShort(value); else if (selector.compareTo(new BigInteger("5")) == 0 || selector.compareTo(new BigInteger("6")) == 0) ; else stream.writeInt(value); stream.close(); }
Example 4
Source File: FullEnumParamChoiceTest.java From zserio with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void writeFullEnumParamChoiceToFile(File file, Selector selector, int value) throws IOException { final FileImageOutputStream stream = new FileImageOutputStream(file); if (selector == Selector.BLACK) stream.writeByte(value); else if (selector == Selector.GREY) stream.writeShort(value); else if (selector == Selector.WHITE) stream.writeInt(value); else fail("Invalid selector: " + selector); stream.close(); }
Example 5
Source File: EnumParamChoiceTest.java From zserio with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void writeEnumParamChoiceToFile(File file, Selector selector, int value) throws IOException { final FileImageOutputStream stream = new FileImageOutputStream(file); if (selector == Selector.BLACK) stream.writeByte(value); else if (selector == Selector.GREY) stream.writeShort(value); else if (selector == Selector.WHITE) stream.writeInt(value); else fail("Invalid selector: " + selector); stream.close(); }
Example 6
Source File: SimpleParamTest.java From zserio with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void writeItemToFile(File file, long version, short param, int extraParam) throws IOException { final FileImageOutputStream stream = new FileImageOutputStream(file); stream.writeShort(param); if (version >= HIGHER_VERSION) stream.writeInt(extraParam); stream.close(); }