Java ByteBuffer Write writeString(String string, ByteBuffer bb)

Here you can find the source of writeString(String string, ByteBuffer bb)

Description

write String

License

Open Source License

Declaration

public static void writeString(String string, ByteBuffer bb) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    public static void writeString(String string, ByteBuffer bb) {
        bb.putShort((short) string.length());
        bb.put(string.getBytes());//w  w w  .  j  a  v a  2  s  .  c o  m
    }
}

Related

  1. writeString(ByteBuffer buf, String value)
  2. writeString(ByteBuffer buffer, String string)
  3. writeString(ByteBuffer byteBuffer, String str)
  4. writeString(final String text, final ByteBuffer out)
  5. writeString(String s, ByteBuffer buff)
  6. writeStringArray(ByteBuffer buf, String[] array)
  7. writeStringData(ByteBuffer buff, String s, int len)
  8. writeStringToBuffer(ByteBuffer buffer, String message)
  9. writeTo(ByteBuffer buffer, File file)