Check-in [78b5f17ee7]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make Minimizer.__dosRound() return the current size.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 78b5f17ee7b094ca0a1001cee6a393d498b84d10
User & Date: stephanie.gawroriski 2019-08-11 13:38:16
Context
2019-08-11
14:27
Add base class for the table section output stream. check-in: e0aa2eeed0 user: stephanie.gawroriski tags: trunk
13:38
Make Minimizer.__dosRound() return the current size. check-in: 78b5f17ee7 user: stephanie.gawroriski tags: trunk
2019-07-31
07:02
Backup developer notes. check-in: 3fc7c5f25b user: squirreljme tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/mini/Minimizer.java.

279
280
281
282
283
284
285



286
287
288
289
290
291
292
...
958
959
960
961
962
963
964

965
966
967
968
969
970
971
972
973
974
975
976
977

978
979
980
981
982
983
984
		
		// Write absolute file size! This saves time in calculating how big
		// a file we have and we can just read that many bytes for all the
		// data areas or similar if needed
		__dos.writeInt(reloff + 4);
		__dos.writeInt((reloff - baserel) + 4);
		



		// Static pool offset and size
		__dos.writeInt(0);
		__dos.writeInt(0);
		
		// Runtime pool offset and size
		__dos.writeInt(0);
		__dos.writeInt(0);
................................................................................
		return baos.toByteArray();
	}
	
	/**
	 * Pads the output stream.
	 *
	 * @param __dos The stream to pad.

	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/04/14
	 */
	static final void __dosRound(DataOutputStream __dos)
		throws IOException, NullPointerException
	{
		if (__dos == null)
			throw new NullPointerException("NARG");
		
		// Add padding
		while ((__dos.size() & 3) != 0)
			__dos.write(0);

	}
	
	/**
	 * Adds length data to the relative offset.
	 *
	 * @param __rel Current relative offset.
	 * @param __v The offset to add.







>
>
>







 







>




|








>







279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
...
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
		
		// Write absolute file size! This saves time in calculating how big
		// a file we have and we can just read that many bytes for all the
		// data areas or similar if needed
		__dos.writeInt(reloff + 4);
		__dos.writeInt((reloff - baserel) + 4);
		
		// Round for the pools
		reloff = Minimizer.__relAdd(reloff, 0);
		
		// Static pool offset and size
		__dos.writeInt(0);
		__dos.writeInt(0);
		
		// Runtime pool offset and size
		__dos.writeInt(0);
		__dos.writeInt(0);
................................................................................
		return baos.toByteArray();
	}
	
	/**
	 * Pads the output stream.
	 *
	 * @param __dos The stream to pad.
	 * @return The current size of the output stream.
	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/04/14
	 */
	static final int __dosRound(DataOutputStream __dos)
		throws IOException, NullPointerException
	{
		if (__dos == null)
			throw new NullPointerException("NARG");
		
		// Add padding
		while ((__dos.size() & 3) != 0)
			__dos.write(0);
		return __dos.size();
	}
	
	/**
	 * Adds length data to the relative offset.
	 *
	 * @param __rel Current relative offset.
	 * @param __v The offset to add.