You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: write_bits.go
    path of file: ./repos/scan4all/vendor/github.com/andybalholm/brotli
    
    the code of the file until where you have to start completion: package brotli

import "encoding/binary"

/* Copyright 2010 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Write bits into a byte array. */

/* This function writes bits into bytes in increasing addresses, and within
   a
    
func writeBits(n_bits uint, bits uint64, pos *uint, array []byte) {
	/* This branch of the code can write up to 56 bits at a time,
	   7 bits are lost by being perhaps already in *p and at least
	   1 bit is needed to initialize the bit-stream ahead (i.e. if 7
	   bits are in *p and we write 57 bits, then the next write will
	   access a byte that was never initialized). */
	p := array[*pos>>3:]
	v := uint64(p[0])
	v |= bits << (*pos & 7)
	binary.LittleEndian.PutUint64(p, v)
	*pos += n_bits
}