code: public static byte[] convertVarIntByteBufferToByteArray(ByteBuffer byteBuffer) {
  	// get the size
  	byte originalVarIntSize=byteBuffer.get();
  	byte varIntSize=getVarIntSize(originalVarIntSize);
  	// reserveBuffer
  	byte[] varInt=new byte[varIntSize];
  	varInt[0]=originalVarIntSize;
  	byteBuffer.get(varInt,1,varIntSize-1);
  	return varInt;
  }
docs: Converts a variable length integer (https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer) from a ByteBuffer to byte array
  
  @param byteBuffer Bytebuffer where to read from the variable length integer
  
  @return byte[] of the variable length integer (including marker)