java.lang.StringBuilder.set()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(182)

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

StringBuilder.set介绍

[英]Sets the length of this string buffer.
[中]设置此字符串缓冲区的长度。

代码示例

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

/**
 * Reads the state of a {@code StringBuilder} from the passed stream and
 * restores it to this instance.
 *
 * @param in
 *            the stream to read the state from.
 * @throws IOException
 *             if the stream throws it during the read.
 * @throws ClassNotFoundException
 *             if the stream throws it during the read.
 */
private void readObject(ObjectInputStream in) throws IOException,
    ClassNotFoundException {
  in.defaultReadObject();
  int count = in.readInt();
  char[] value = (char[]) in.readObject();
  set(value, count);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Reads the state of a {@code StringBuilder} from the passed stream and
 * restores it to this instance.
 *
 * @param in
 *            the stream to read the state from.
 * @throws IOException
 *             if the stream throws it during the read.
 * @throws ClassNotFoundException
 *             if the stream throws it during the read.
 */
private void readObject(ObjectInputStream in) throws IOException,
    ClassNotFoundException {
  in.defaultReadObject();
  int count = in.readInt();
  char[] value = (char[]) in.readObject();
  set(value, count);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Reads the state of a {@code StringBuilder} from the passed stream and
 * restores it to this instance.
 *
 * @param in
 *            the stream to read the state from.
 * @throws IOException
 *             if the stream throws it during the read.
 * @throws ClassNotFoundException
 *             if the stream throws it during the read.
 */
private void readObject(ObjectInputStream in) throws IOException,
    ClassNotFoundException {
  in.defaultReadObject();
  int count = in.readInt();
  char[] value = (char[]) in.readObject();
  set(value, count);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Reads the state of a {@code StringBuilder} from the passed stream and
 * restores it to this instance.
 *
 * @param in
 *            the stream to read the state from.
 * @throws IOException
 *             if the stream throws it during the read.
 * @throws ClassNotFoundException
 *             if the stream throws it during the read.
 */
private void readObject(ObjectInputStream in) throws IOException,
    ClassNotFoundException {
  in.defaultReadObject();
  int count = in.readInt();
  char[] value = (char[]) in.readObject();
  set(value, count);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Reads the state of a {@code StringBuilder} from the passed stream and
 * restores it to this instance.
 *
 * @param in
 *            the stream to read the state from.
 * @throws IOException
 *             if the stream throws it during the read.
 * @throws ClassNotFoundException
 *             if the stream throws it during the read.
 */
private void readObject(ObjectInputStream in) throws IOException,
    ClassNotFoundException {
  in.defaultReadObject();
  int count = in.readInt();
  char[] value = (char[]) in.readObject();
  set(value, count);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Reads the state of a {@code StringBuilder} from the passed stream and
 * restores it to this instance.
 *
 * @param in
 *            the stream to read the state from.
 * @throws IOException
 *             if the stream throws it during the read.
 * @throws ClassNotFoundException
 *             if the stream throws it during the read.
 */
private void readObject(ObjectInputStream in) throws IOException,
    ClassNotFoundException {
  in.defaultReadObject();
  int count = in.readInt();
  char[] value = (char[]) in.readObject();
  set(value, count);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Reads the state of a {@code StringBuilder} from the passed stream and
 * restores it to this instance.
 *
 * @param in
 *            the stream to read the state from.
 * @throws IOException
 *             if the stream throws it during the read.
 * @throws ClassNotFoundException
 *             if the stream throws it during the read.
 */
private void readObject(ObjectInputStream in) throws IOException,
    ClassNotFoundException {
  in.defaultReadObject();
  int count = in.readInt();
  char[] value = (char[]) in.readObject();
  set(value, count);
}

相关文章

微信公众号

最新文章

更多