I am making a 2d networked game and currently am sending integers through my server successfully, But i would like to enable a system that allows custom skins, so I would like to know if there is a way to send images over java using the default files, if so could I have an example of how this is done?

I don't think you understand. Data never take any form, other than bytes. You decide how to interpret these bytes though.

You can send the bytes of an image over the network, and interpret those bytes as an image when you recieve them. Example:I can send 32 bits over the network, in a packet. When I receive them, I can interpret them as an integer, representing one huge number. However, I can also interpret them as a coordinate set composed of two shorts (16 bit each). Yet again, I can interpret them as four letters (4 bits per letter). Then again, I can interpret them as three letters, and a number between -127 and 127. It's the same data I'm sending though.

This is what protocols are for. You have to decide how you interpret the data you're sending over the network. It's the same reason you can open any file-type with any software in Windows. It's all the same data, but different software make different expectations to it, and interpret it a specific way.

I was just giving an idea of what he could do; which is send the image's pixels in the form of an integer and interpret them on the client as an integer.

Anyways, I don't think sending images from the client to the server is a great idea unless they're being cached/saved somewhere where they can be re-loaded, and if you plan on having those same images change then somehow a way to check if they're the same version as the servers. (Like a CRC check or something.)

I was just giving an idea of what he could do; which is send the image's pixels in the form of an integer and interpret them on the client as an integer.

Anyways, I don't think sending images from the client to the server is a great idea unless they're being cached/saved somewhere where they can be re-loaded, and if you plan on having those same images change then somehow a way to check if they're the same version as the servers. (Like a CRC check or something.)

Since this is in the context of gaming, I'll agree with you. I can think of multiple instances where I'd like to send image information over a network with java though.

Now look at java.io.ObjectOutputStream and java.io.ObjectInputStream etc.

I haven't tried this. There's probably some additional overhead too, but probably not much compared to the image data. It might be worth compressing the data before transmission too. It might be better to make a general purpose update utility, so you can update any file on load, not just the skins.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org