public static int encodingSizeInBytes(EllipticCurve curve, PointFormatType format)
      throws GeneralSecurityException {
    int coordinateSize = fieldSizeInBytes(curve);
    switch (format) {
      case UNCOMPRESSED:
        return 2 * coordinateSize + 1;
      case DO_NOT_USE_CRUNCHY_UNCOMPRESSED:
        return 2 * coordinateSize;
      case COMPRESSED:
        return coordinateSize + 1;
    }
    throw new GeneralSecurityException("unknown EC point format");
  }
Returns the encoding size of a point on an elliptic curve.

@param curve the elliptic curve
@param format the format used to encode the point
@return the size of an encoded point in bytes
@throws GeneralSecurityException if the point format is unknown or if the elliptic curve is not
    supported
java_src/src/main/java/com/google/crypto/tink/subtle/EllipticCurves.java