Community
Participate
Working Groups
Build ID: M20080911-1700 Steps To Reproduce: The class org.eclipse.ecf.protocol.bittorrent.internal.encode.Encode contains the static method: putIntegerAsFourBytes(byte[] haveArray, int number, int index) Create a class to call this method and run the following code: byte[] data = new byte[4]; Encode.putIntegerAsFourBytes(data, 64 * 1024, 0); for (int i = 0; i < data.length; i++) { System.out.print(data[i] + " "); } With the current implementation the output is: 0 0 0 0 The output should be: 0 1 0 0 More information: This bug causes incompatibilities (including data corruption) with clients that rely on the Request message specifying the correct offset.
Created attachment 123018 [details] Proposed patch This code is a bit clearer in what it does than the original.
Assigning to Remy for review/application of patch.
Seems like this could be fixed quickly/easily. Remy if this is incorrect please advise.
Fix released to HEAD. Thanks for the patch, Matthew.