Error decoding UtfString

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Posts: 97
Joined: 27 Jan 2009, 21:34

Error decoding UtfString

Postby dingo » 01 May 2011, 14:54


I'm sending a Base64 encoded image to the server as a UtfString.
But I'm getting the following error on the Server:

WARN [SocketReader] protocol.SFSProtocolCodec - Error deserializing request: java.lang.IllegalArgumentException: Error decoding UtfString. Negative size: -3154

This only happens with some images, others work fine.
Is it possible that some images are too big so the UtfString is so long, that it turns negative? If yes, what is the length limit on UtfString?

Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 01 May 2011, 17:35

You can see the limits here: ... t-sfsarray

Best thing is to use byte array for things like what you do

Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter:
Posts: 97
Joined: 27 Jan 2009, 21:34

Postby dingo » 01 May 2011, 18:00

i see.

many thanks! :D

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Aldenea, DavinVicy, DerikFent, JerodSa and 21 guests