All answers are given correctly. However, you can take the source of DataOutputStream, insert it into a new class and reverse the byte order in different writeShort, writeLong, etc. (Or at least the ones you need). This is not such a difficult job.
Obviously, you cannot use it to communicate with a DataInputStream on the other hand, but I suppose you need to write to a file or socket with a program on the other side, so you do not need a DataInputStream.
source share