code: private byte buildFlagsByte() {
  
  		byte flag = 0;
  
  		// Add the binary type to bit 5, 0 for standard and 1 for extended
  		int binaryType = extended ? 1 : 0;
  		flag += (binaryType << 5);
  
  		// Add the empty geometry flag to bit 4, 0 for non-empty and 1 for
  		// empty
  		int emptyValue = empty ? 1 : 0;
  		flag += (emptyValue << 4);
  
  		// Add the envelope contents indicator code (3-bit unsigned integer to
  		// bits 3, 2, and 1)
  		int envelopeIndicator = envelope == null ? 0 : getIndicator(envelope);
  		flag += (envelopeIndicator << 1);
  
  		// Add the byte order to bit 0, 0 for Big Endian and 1 for Little
  		// Endian
  		int byteOrderValue = (byteOrder == ByteOrder.BIG_ENDIAN) ? 0 : 1;
  		flag += byteOrderValue;
  
  		return flag;
  	}
docs: Build the flags byte from the flag values
  
  @return envelope indicator