org.kaazing.k3po.lang.el.Function.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.kaazing.k3po.lang.el.Function.<init>()方法的一些代码示例,展示了Function.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.<init>()方法的具体详情如下:
包路径:org.kaazing.k3po.lang.el.Function
类名称:Function
方法名:<init>

Function.<init>介绍

暂无

代码示例

代码示例来源:origin: k3po/k3po

@Function
public static byte[] allBytes() {
  byte[] bytes = new byte[256];
  for (int i = 0; i < 256; i++) {
    bytes[i] = (byte) i;
  }
  return bytes;
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] portXOR(int port) {
  byte[] x = new byte[2];
  byte one = (byte)(port >> 8);
  byte two = (byte)(port);
  x[0] = (byte)(one ^ 0x21); // magic cookie byte 1
  x[1] = (byte)(two ^ 0x12); // magic cookie byte 2
  return x;
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] randomBytes(int length) {
  byte[] bytes = new byte[length];
  for (int i = 0; i < length; i++) {
    bytes[i] = (byte) RANDOM.nextInt(0x100);
  }
  return bytes;
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] randomBytes(int length) {
  byte[] bytes = new byte[length];
  for (int i = 0; i < length; i++) {
    bytes[i] = (byte) RANDOM.nextInt(0x100);
  }
  return bytes;
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] copyOfRange(byte[] original, int from, int to) {
  return Arrays.copyOfRange(original, from, to);
}

代码示例来源:origin: k3po/k3po

@Function
public static String randomMethodNot(String method) {
  String[] methods = new String[]{"GET", "OPTIONS", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT"};
  String result;
  do {
    result = methods[RANDOM.nextInt(methods.length)];
  } while (result.equalsIgnoreCase(method));
  return result;
}

代码示例来源:origin: k3po/k3po

@Function
public static String append(String... strings) {
  StringBuilder result = new StringBuilder();
  for (String string : strings) {
    result.append(string);
  }
  return result.toString();
}

代码示例来源:origin: k3po/k3po

@Function
public static String append(String... strings) {
  StringBuilder x = new StringBuilder();
  for (String s:strings) {
    x.append(s);
  }
  return x.toString();
}

代码示例来源:origin: k3po/k3po

@Function
public static String append(String... strings) {
  StringBuilder x = new StringBuilder();
  for (String s:strings) {
    x.append(s);
  }
  return x.toString();
}

代码示例来源:origin: k3po/k3po

@Function
public static String getDate() {
  SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss");
  return format.format(new Date()) + " GMT";
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] randomAscii(int length) {
  Random r = new Random();
  byte[] result = new byte[length];
  String alphabet =
      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "1234567890!@#$%^&*()_+-=`~[]\\{}|;':\",./<>?";
  for (int i = 0; i < length; i++) {
    result[i] = (byte) alphabet.charAt(r.nextInt(alphabet.length()));
  }
  return result;
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] randomBytesInvalidUTF8(int length) {
  // TODO: make invalid UTF-8 bytes less like valid UTF-8 (!)
  byte[] bytes = new byte[length];
  bytes[0] = (byte) 0x80;
  randomBytesUTF8(bytes, 1, length - 1);
  return bytes;
}

代码示例来源:origin: k3po/k3po

/**
 * Utility method for creating a MessageProp object using the default
 * Quality of Protection (0) and the given privacy setting.
 * @param usePrivacy whether or not the messages being sent using this MessageProp
 *        require privacy
 * @return the newly created MessageProp object with default QoP
 */
@Function
public static MessageProp createMessageProp(boolean usePrivacy) {
  // default Quality of Protection (0), use privacy (passed int)
  return new MessageProp(0, usePrivacy);
}

代码示例来源:origin: k3po/k3po

@Function
public static String handshakeKey() {
  byte[] bytes = new byte[16];
  RANDOM.nextBytes(bytes);
  return new String(Base64.encode(bytes), US_ASCII);
}

代码示例来源:origin: k3po/k3po

@Function
public static String handshakeHash(String wsKey) throws NoSuchAlgorithmException {
  MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
  sha1.update(wsKey.getBytes(US_ASCII));
  byte[] digest = sha1.digest(WEBSOCKET_GUID);
  return new String(Base64.encode(digest), US_ASCII);
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] settingsWithHeaderTableSize8192() {
  byte[] bytes = new byte[] { 0x00, 0x01, 0x00, 0x00, 0x20, 0x00 };
  return Base64URL.encode(bytes);
}

代码示例来源:origin: k3po/k3po

@Function
public static byte[] randomBytesUTF8(int length) {
  byte[] bytes = new byte[length];
  randomBytesUTF8(bytes, 0, length);
  return bytes;
}

代码示例来源:origin: k3po/k3po

@Function
public static String loginBase64Encoder(String login) {
  byte[] bytes = login.getBytes();
  return bytesToString(Base64.encode(bytes));
}

代码示例来源:origin: k3po/k3po

@Function
public static String loginBase64Encoder(String login) {
  byte[] bytes = login.getBytes();
  return bytesToString(Base64.encode(bytes));
}

代码示例来源:origin: k3po/k3po

@Function
public static ChannelWriter manyToOneWriter(AtomicBuffer buffer) {
  return new RingBufferChannelWriter(new ManyToOneRingBuffer(buffer));
}

相关文章