bayard 2003/11/26 18:58:10
Modified: io/src/java/org/apache/commons/io EndianUtils.java
Log:
It seems that the values passed into writeShort methods should be shorts not ints.
Revision Changes Path
1.5 +3 -3
jakarta-commons-sandbox/io/src/java/org/apache/commons/io/EndianUtils.java
Index: EndianUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/io/src/java/org/apache/commons/io/EndianUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- EndianUtils.java 13 Oct 2003 07:04:52 -0000 1.4
+++ EndianUtils.java 27 Nov 2003 02:58:10 -0000 1.5
@@ -143,7 +143,7 @@
* @param offset starting offset in the byte array
* @param value value to write
*/
- public static void writeSwappedShort( final byte[] data, final int offset,
final int value )
+ public static void writeSwappedShort( final byte[] data, final int offset,
final short value )
{
data[ offset + 0 ] = (byte)( ( value >> 0 ) & 0xff );
data[ offset + 1 ] = (byte)( ( value >> 8 ) & 0xff );
@@ -321,7 +321,7 @@
* @param value value to write
* @throws IOException in case of an I/O problem
*/
- public static void writeSwappedShort( final OutputStream output, final int
value )
+ public static void writeSwappedShort( final OutputStream output, final short
value )
throws IOException
{
output.write( (byte)( ( value >> 0 ) & 0xff ) );
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]