Na most van valami siker, de már úgy megkavarodtam, hogy azt sem tudom hol vagyok. Szóval az egyik fő probléma az lehetett, hogy a java kódból másolt byte tömböt byte-ként deklaráltam és kezeltem, pedig a java byte-ja a C# sbyte-jának felel meg.
Na a lényeg, hogy ha kiíratom az első dekódolt 32 byteot javaban, és C#-ban, akkor stimmel mindegyik.
De ezután kéne jönnie egy kicsomagolásnak Zlib alapon, ami nem megy, mert "An unhandled exception of type 'System.IO.InvalidDataException' occurred in System.dll
Additional information: The magic number in GZip header is not correct. Make sure you are passing in a GZip stream."
Java-ban InflaterInputStream-en megy keresztül ami az Inflater() kicsomagolót használja, C#-nál a GZipStream-en menne át ha menne, mert elvileg a zlib, gzip, pkzip kompatibilis egymással.
A javas inflater dokumentációban viszont van egy ilyen: "If the parameter 'nowrap' is true then the ZLIB header and checksum fields will not be used. This provides compatibility with the compression format used by both GZIP and PKZIP. "
Gondolom ezért C#-ban pár byteot ki kéne hagyni... de hol és mennyit...
Viszont van már DeflateStream is a .net-ben, ami full Zlib kompatibilis. Ez már más hibát ír ki "An unhandled exception of type 'System.IO.InvalidDataException' occurred in System.dll
Additional information: Block length does not match with its complement." akár akkor is ha egy ReadByte()-ot nyomok
[ Szerkesztve ]
hitler, sztálin, micro usb