int writeBytes(OutputStream out)
        throws IOException
    {
        int length = myBuffer.length - myOffset;
        byte[] bytes = new byte[length];
        System.arraycopy(myBuffer, myOffset, bytes, 0, length);
        out.write(bytes);
        return length;
    }
int writeBytes ( OutputStream out ) throws IOException { int length = myBuffer . length - myOffset ; byte [ ] bytes = new byte [ length ] ; System . arraycopy ( myBuffer , myOffset , bytes , 0 , length ) ; out . write ( bytes ) ; return length ; }
Copies the current contents of the Ion binary-encoded byte array to a
specified stream.
<p>
This makes an unchecked assumption that {{@link #serialize(IonDatagram)}
is already called.

@return the number of bytes written into {@code out}

@throws IOException