public static int writeByteArray(final byte[] tgt,final int tgtOffset,final byte[] src,final int srcOffset,final int srcLength){
  byte[] vint=vintToBytes(srcLength);
  System.arraycopy(vint,0,tgt,tgtOffset,vint.length);
  int offset=tgtOffset + vint.length;
  System.arraycopy(src,srcOffset,tgt,offset,srcLength);
  return offset + srcLength;
}

public static int writeByteArray ( final byte [ ] tgt , final int tgtOffset , final byte [ ] src , final int srcOffset , final int srcLength ) { byte [ ] vint = vintToBytes ( srcLength ) ; System . arraycopy ( vint , 0 , tgt , tgtOffset , vint . length ) ; int offset = tgtOffset + vint . length ; System . arraycopy ( src , srcOffset , tgt , offset , srcLength ) ; return offset + srcLength ; }
write byte - array from src to tgt with a vint length prefix .
