//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void addGenotype(final BCF2Encoder encoder, final org.broadinstitute.variant.variantcontext.VariantContext vc, final org.broadinstitute.variant.variantcontext.Genotype g) throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
            public override void addGenotype(BCF2Encoder encoder, VariantContext vc, Genotype g)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int samplePloidy = g.getPloidy();
                int samplePloidy = g.Ploidy;

                for (int i = 0; i < nValuesPerGenotype; i++)
                {
                    if (i < samplePloidy)
                    {
                        // we encode the actual allele
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.broadinstitute.variant.variantcontext.Allele a = g.getAllele(i);
                        Allele a = g.getAllele(i);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int offset = getAlleleOffset(a);
                        int offset = getAlleleOffset(a);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int encoded = ((offset+1) << 1) | (g.isPhased() ? 0x01 : 0x00);
                        int encoded = ((offset + 1) << 1) | (g.Phased ? 0x01 : 0x00);
                        encoder.encodeRawBytes(encoded, encodingType);
                    }
                    else
                    {
                        // we need to pad with missing as we have ploidy < max for this sample
                        encoder.encodeRawBytes(encodingType.MissingBytes, encodingType);
                    }
                }
            }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @Requires({"minValues <= 1", "value != null", "value instanceof Boolean", "((Boolean)value) == true"}) public void encodeValue(final BCF2Encoder encoder, final Object value, final org.broadinstitute.variant.bcf2.BCF2Type type, final int minValues) throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
            public override void encodeValue(BCF2Encoder encoder, object value, BCF2Type type, int minValues)
            {
                encoder.encodeRawBytes(1, StaticType);
            }