jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java
changeset 14664 e71aa0962e70
parent 14342 8435a30053c1
child 25669 daa21271c03b
equal deleted inserted replaced
14663:49b7de969579 14664:e71aa0962e70
    92     // The caller must NOT modify the contents.
    92     // The caller must NOT modify the contents.
    93     int[] curveIds() {
    93     int[] curveIds() {
    94         return curveIds;
    94         return curveIds;
    95     }
    95     }
    96 
    96 
       
    97     @Override
    97     int length() {
    98     int length() {
    98         return 6 + (curveIds.length << 1);
    99         return 6 + (curveIds.length << 1);
    99     }
   100     }
   100 
   101 
       
   102     @Override
   101     void send(HandshakeOutStream s) throws IOException {
   103     void send(HandshakeOutStream s) throws IOException {
   102         s.putInt16(type.id);
   104         s.putInt16(type.id);
   103         int k = curveIds.length << 1;
   105         int k = curveIds.length << 1;
   104         s.putInt16(k + 2);
   106         s.putInt16(k + 2);
   105         s.putInt16(k);
   107         s.putInt16(k);
   106         for (int curveId : curveIds) {
   108         for (int curveId : curveIds) {
   107             s.putInt16(curveId);
   109             s.putInt16(curveId);
   108         }
   110         }
   109     }
   111     }
   110 
   112 
       
   113     @Override
   111     public String toString() {
   114     public String toString() {
   112         StringBuilder sb = new StringBuilder();
   115         StringBuilder sb = new StringBuilder();
   113         sb.append("Extension " + type + ", curve names: {");
   116         sb.append("Extension " + type + ", curve names: {");
   114         boolean first = true;
   117         boolean first = true;
   115         for (int curveId : curveIds) {
   118         for (int curveId : curveIds) {