Java ByteBuffer Write writeByteString(ByteBuffer byteBuffer, String value)

Here you can find the source of writeByteString(ByteBuffer byteBuffer, String value)

Description

write Byte String

License

Open Source License

Declaration

private static void writeByteString(ByteBuffer byteBuffer, String value) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    private static void writeByteString(ByteBuffer byteBuffer, String value) {
        byteBuffer.putInt(value.length());
        byteBuffer.put(value.getBytes());

    }//from   w ww.  j  a v a 2s  . co m
}

Related

  1. writeByteArray(ByteBuffer logBuf, byte[] b)
  2. writeByteBuffer(ByteBuffer bbuf, String filename)
  3. writeByteBuffer(RandomAccessFile file, ByteBuffer buffer)
  4. writeByteBuffer(WritableByteChannel channel, ByteBuffer buf, int bytesToWrite)
  5. writeBytesNoLength(ByteBuffer logBuf, byte[] b)
  6. writeCDouble(ByteBuffer buffer, double value)
  7. writeCharacterString(ByteBuffer buf, byte[] bytes)
  8. writeCInt(ByteBuffer buffer, int anInt)
  9. writeColorTable(ByteBuffer out, int numColors)