Java OSC
Important update!
Please note that a new version of JavaOSC has been released that includes the patches below. Please use the new release in preference to patching old versions of the source. This page remains here purely for informational purposes, or posterity, or something like that.
Introduction
The problem: if you use JavaOSC and send a BigInteger object down the pipe, you get an Integer object at the other end, and suffer the associated loss of accuracy with going from a 64bit number to a 32bit number.
This may not be a problem for most, but if you are using the number for, say, insanely accurate timing data, it's a pain in the behind.
The solution: a small patch to the source code.
Please note - this patch will probably be incoporated into the next release of JavaOSC, so no worries about upgrading..
Download
The patch files 650B
A pre-patched version of the source 38K
A pre-built .jar 40K
Compilation
If you downloaded the patch files, copy them to the '/src/com/illposed/osc/utility/' directory under where you extraced the original JavaOSC source (get a copy of the source from here) and from that directory, run the following commands:
-
patch OSCByteArrayToJavaConverter.java < OSCByteArrayToJavaConverter.java.patch
-
patch OSCJavaToByteArrayConverter.java < OSCJavaToByteArrayConverter.java.patch
-
rm ./*.patch
-
cd ../../../../../
-
ant
You may also need to edit OSCBundle.java and OSCMessage.java in the directory /src/com/illposed/osc/ to get it to compile under Java 1.5 - just change the variable named 'enum' to something like 'vecEnum' throughout the two source files and you should be fine.
The above assumes you are either on Linux or OS X. If you are on Windows, google for an alternative to patch, or open the patch files in notepad and make the changes manually (there aren't very many..).
If you downloaded the patched source, untar the archive and build with ant as normal.
If you downloaded the .jar file, no compilation is necessary - jump straight to the installation instructions.
Installation
Put the resulting javaosc.jar file in the jre/lib/ext/ directory of your Java install. Mine lives at /opt/sun-jdk-1.5.0.06/jre/lib/ext/ Yours may be at C:/Program Files/Java/jdk1.5.0_06/jre/lib/ext/ or /System/Library/Java/Extensions/ or somewhere else. It's a mystery.
Usage
No special instructions here, just treat it like you would the unpatched JavaOSC version, but enjoy the 64bit goodness.
Popularity: 3% [?]