code: private static List<SNIServerName> exploreClientHello(
              ByteBuffer input,
              byte recordMajorVersion,
              byte recordMinorVersion) throws SSLException {
  
          ExtensionInfo info = null;
  
          // client version
          input.get(); //helloMajorVersion
          input.get(); //helloMinorVersion
  
          // ignore random
          int position = input.position();
          input.position(position + 32);  // 32: the length of Random
  
          // ignore session id
          ignoreByteVector8(input);
  
          // ignore cipher_suites
          int csLen = getInt16(input);
          while (csLen > 0) {
              getInt8(input);
              getInt8(input);
              csLen -= 2;
          }
  
          // ignore compression methods
          ignoreByteVector8(input);
  
          if (input.remaining() > 0) {
              info = exploreExtensions(input);
          }
  
          final List<SNIServerName> snList = info != null ? info.sni : Collections.emptyList();
  
          return snList;
      }
docs: /*
  struct {
  uint32 gmt_unix_time;
  opaque random_bytes[28];
  } Random;
  
  opaque SessionID<0..32>;
  
  uint8 CipherSuite[2];
  
  enum { null(0), (255) } CompressionMethod;
  
  struct {
  ProtocolVersion client_version;
  Random random;
  SessionID session_id;
  CipherSuite cipher_suites<2..2^16-2>;
  CompressionMethod compression_methods<1..2^8-1>;
  select (extensions_present) {
  case false:
  struct {};
  case true:
  Extension extensions<0..2^16-1>;
  };
  } ClientHello;