java.io.DataOutputStream.writeChars()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(114)

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

DataOutputStream.writeChars介绍

[英]Writes a string to the underlying output stream as a sequence of characters. Each character is written to the data output stream as if by the writeChar method. If no exception is thrown, the counter written is incremented by twice the length of s.
[中]将字符串作为字符序列写入基础输出流。每个字符都被写入数据输出流,就像通过writeChar方法一样。如果未引发异常,则计数器written的长度将增加两倍s

代码示例

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

@Override
public final void writeChars(String s) throws IOException {
  out.writeChars(s);
}

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

public final void writeChars (String s) throws IOException {
  dos.writeChars(s);
}

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

public final void writeChars (String s) throws IOException {
  dos.writeChars(s);
}

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

@Override
public final void writeChars(String s) throws IOException {
  out.writeChars(s);
}

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

@Override
public final void writeChars(String s) throws IOException {
  out.writeChars(s);
}

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

@Override
public void writeChars(String s) throws IOException
{
  m_dataOutputStream.writeChars(s);
}

代码示例来源:origin: aragozin/jvm-tools

@Override
public void writeChars(String s) throws IOException {
  dos.writeChars(s);
}

代码示例来源:origin: io.netty/netty

public final void writeChars(String s) throws IOException {
  out.writeChars(s);
}

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

/**
 * Writes the string {@code value} as a sequence of characters to the target
 * stream.
 *
 * @param value
 *            the string to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeChars(String value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeChars(value);
}

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

@Override
  public void printTo(DataOutputStream out) throws IOException {
    while(keyIterator.hasNext()) {
      byte[] keyBytes = keyIterator.next().get();
      out.writeInt(keyBytes.length);
      out.write(keyBytes);
      out.writeChars(ByteUtils.toHexString(keyBytes) + "\n");
    }
  }
});

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

@Override
  public void printTo(DataOutputStream out) throws IOException {
    while(keyIterator.hasNext()) {
      byte[] keyBytes = keyIterator.next().get();
      out.writeChars(ByteUtils.toHexString(keyBytes) + "\n");
    }
  }
});

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

@Override
  public void printTo(DataOutputStream out) throws IOException {
    while(keyIterator.hasNext()) {
      byte[] keyBytes = keyIterator.next().get();
      out.writeChars(ByteUtils.toHexString(keyBytes) + "\n");
    }
  }
});

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

@Override
  public void printTo(DataOutputStream out) throws IOException {
    while(entriesIterator.hasNext()) {
      Pair<ByteArray, Versioned<byte[]>> kvPair = entriesIterator.next();
      byte[] keyBytes = kvPair.getFirst().get();
      VectorClock clock = ((VectorClock) kvPair.getSecond().getVersion());
      byte[] valueBytes = kvPair.getSecond().getValue();
      out.writeChars(ByteUtils.toHexString(keyBytes));
      out.writeChars(",");
      out.writeChars(clock.toString());
      out.writeChars(",");
      out.writeChars(ByteUtils.toHexString(valueBytes));
      out.writeChars("\n");
    }
  }
});

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

@Override
  public void printTo(DataOutputStream out) throws IOException {
    while(entryIterator.hasNext()) {
      Pair<ByteArray, Versioned<byte[]>> kvPair = entryIterator.next();
      byte[] keyBytes = kvPair.getFirst().get();
      VectorClock clock = ((VectorClock) kvPair.getSecond().getVersion());
      byte[] valueBytes = kvPair.getSecond().getValue();
      out.writeChars(ByteUtils.toHexString(keyBytes));
      out.writeChars(",");
      out.writeChars(clock.toString());
      out.writeChars(",");
      out.writeChars(ByteUtils.toHexString(valueBytes));
      out.writeChars("\n");
    }
  }
});

代码示例来源:origin: apache/incubator-gobblin

dos.writeChars(schema.toString());

代码示例来源:origin: pentaho/pentaho-kettle

dos.writeChars( name );
    String string = getBigNumber().toString();
    dos.writeInt( string.length() );
    dos.writeChars( string );

代码示例来源:origin: pentaho/pentaho-kettle

String string = getBigNumber().toString();
dos.writeInt( string.length() );
dos.writeChars( string );

代码示例来源:origin: org.apache.mina/mina-core

/**
 * {@inheritDoc}
 */
@Override
public void writeChars(String s) throws IOException {
  out.writeChars(s);
}

代码示例来源:origin: stackoverflow.com

ByteArrayOutputStream out = new ByteArrayOutputStream();
{
  // conversion from "yourObject" to byte[]
  DataOutputStream dos = new DataOuputStream(out);
  dos.writeInt(yourObject.intProperty);
  dos.writeByte(yourObject.byteProperty);
  dos.writeFloat(yourObject.floatProperty);
  dos.writeChars(yourObject.stringProperty);
  dos.close();
}
byte[] byteArray = out.toByteArray();

代码示例来源:origin: kaikramer/keystore-explorer

private void saveExtensions(Map<String, byte[]> extensions, DataOutputStream dos) throws IOException {
    dos.writeInt(extensions.size());

    for (String oid : extensions.keySet()) {
      dos.writeInt(oid.length());
      dos.writeChars(oid);

      byte[] value = extensions.get(oid);
      dos.writeInt(value.length);
      dos.write(value);
    }
  }
}

相关文章