WriteTupleHead() public method

Write an Erlang tuple header to the stream. After calling this method, you must write 'arity' elements to the stream or it will not be possible to decode it later.
public WriteTupleHead ( int arity ) : void
arity int The number of elements in the tuple.
return void
        public void Can_Parse_RpbErrorResp_In_1_Tuple()
        {
            byte[] b = null;
            using (var os = new OtpOutputStream())
            {
                os.WriteTupleHead(1);
                os.WriteAtom(TtbErrorDecoder.RpbErrorRespAtom);
                os.Flush();
                b = os.ToArray();
            }

            var ex = Assert.Throws<RiakException>(() => new TsTtbResp(b));
            Assert.IsTrue(ex.Message.Contains(TtbErrorDecoder.RpbErrorRespEmpty));
        }
        public void Can_Parse_RpbErrorResp_In_3_Tuple()
        {
            byte[] b = null;
            using (var os = new OtpOutputStream())
            {
                os.WriteTupleHead(3);
                os.WriteAtom(TtbErrorDecoder.RpbErrorRespAtom);
                os.WriteLong(ErrCode);
                os.WriteStringAsBinary(ErrMsg);
                os.Flush();
                b = os.ToArray();
            }

            var ex = Assert.Throws<RiakException>(() => new TsTtbResp(b));
            Assert.IsTrue(ex.Message.Contains(ErrCode.ToString()));
            Assert.IsTrue(ex.Message.Contains(ErrMsg));
        }
        public void Write_List_And_Tuple()
        {
            byte[] want = new byte[]
            {
                131, 108, 0, 0, 0, 2, 104, 2, 100, 0, 4, 116, 114, 117, 101, 100, 0, 5, 
                102, 97, 108, 115, 101, 108, 0, 0, 0, 2, 100, 0, 4, 116, 114, 117, 101, 
                100, 0, 5, 102, 97, 108, 115, 101, 106, 106
            };
            byte[] got;
            using (var os = new OtpOutputStream())
            {
                os.WriteByte(OtpExternal.VersionTag);
                os.WriteListHead(2);
                os.WriteTupleHead(2);
                os.WriteBoolean(true);
                os.WriteBoolean(false);
                os.WriteListHead(2);
                os.WriteBoolean(true);
                os.WriteBoolean(false);
                os.WriteNil();
                os.WriteNil();
                Assert.AreEqual(want.Length, os.Position);
                got = os.ToArray();
            }

            CollectionAssert.AreEqual(want, got);
        }