code: protected org.jboss.marshalling.Marshaller prepareForMarshalling(final DataOutput dataOutput) throws IOException {
          final org.jboss.marshalling.Marshaller marshaller = this.getMarshaller(marshallerFactory);
          final OutputStream outputStream = new OutputStream() {
              @Override
              public void write(int b) throws IOException {
                  final int byteToWrite = b & 0xff;
                  dataOutput.write(byteToWrite);
              }
  
              @Override
              public void write(final byte[] b) throws IOException {
                  dataOutput.write(b);
              }
  
              @Override
              public void write(final byte[] b, final int off, final int len) throws IOException {
                  dataOutput.write(b, off, len);
              }
          };
          final ByteOutput byteOutput = Marshalling.createByteOutput(outputStream);
          // start the marshaller
          marshaller.start(byteOutput);
  
          return marshaller;
      }
docs: Creates and returns a {@link org.jboss.marshalling.Marshaller} which is ready to be used for marshalling. The
  {@link org.jboss.marshalling.Marshaller#start(org.jboss.marshalling.ByteOutput)} will be invoked by this method, to use
  the passed {@link java.io.DataOutput dataOutput}, before returning the marshaller.
  
  @param dataOutput The {@link java.io.DataOutput} to which the data will be marshalled
  @return
  @throws IOException