title: How to change endianness when unmarshalling a CDR stream containing valuetype objects in Java
body: <p>I've got marshaled CDR data all by itself in the form of a file (i.e., not packed in a GIOP message) which I need to unmarshal and display on the screen. I get to know what type the data is and have working code to do this successfully by the following:</p>
  
  <pre><code>ValueFactory myFactory = (ValueFactory)myConstructor.newInstance( objParam );
  StreamableValue myObject = myFactory.init();
  myObject._read( myCDRInputStream );
  </code></pre>
  
  <p>where init() calls the constructor of myObjectImpl(). and _read is the org.omg.CORBA.portable.Streamable _read(InputStream) method.</p>
  
  <p>This works as long as the marshaled data is of the same endianness as the computer running my reader program, but I will need to be able to handle cases where the endianness of the data is different than the endianness of the computer running the reader. I know that endianness is in GIOP messages, which I don't have. Assuming I figure out that I need to change the endianness, how can I tell this to the stream reader?</p>
  
  <p>Thanks!</p>