int toNewByteArray(byte[] dst)
    {
        int length = myBuffer.length - myOffset;
        System.arraycopy(myBuffer, myOffset, dst, 0, length);
        return length;
    }
int toNewByteArray ( byte [ ] dst ) { int length = myBuffer . length - myOffset ; System . arraycopy ( myBuffer , myOffset , dst , 0 , length ) ; return length ; }
Copies the current contents of the Ion binary-encoded byte array into a
a given byte array.
<p>
The given array must be large enough to contain all the bytes of the
Ion binary-encoded byte array.
<p>
This makes an unchecked assumption that {{@link #serialize(IonDatagram)}
is already called.
<p>
TODO To be deprecated along with {@link IonDatagram#getBytes(byte[])}

@param dst the byte array into which bytes are to be written

@return the number of bytes copied into {@code dst}