Java ByteBuffer Put putString(String name, ByteBuffer buffer)

Here you can find the source of putString(String name, ByteBuffer buffer)

Description

put String

License

Open Source License

Parameter

Parameter Description
name a parameter
buffer a parameter

Declaration

public static void putString(String name, ByteBuffer buffer) 

Method Source Code


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

import java.io.IOException;

import java.io.OutputStream;
import java.nio.ByteBuffer;

public class Main {
    public static void putString(String string, OutputStream out) throws IOException {
        out.write(string.getBytes());/*www.  j a v  a  2  s .  c  o  m*/
        out.write(0);
    }

    /**
     * @param name
     * @param buffer
     */
    public static void putString(String name, ByteBuffer buffer) {
        buffer.put(name.getBytes()).put((byte) 0);

    }
}

Related

  1. putString(ByteBuffer bb, String s)
  2. putString(ByteBuffer buf, String value)
  3. putString(ByteBuffer buffer, String s)
  4. putString(ByteBuffer buffer, String s)
  5. putString(final ByteBuffer buffer, final String string)
  6. putString(String str, ByteBuffer bb)
  7. putStringAsCharArray(ByteBuffer byteBuffer, String s)
  8. putStringToByteBuffer(final ByteBuffer bb, String value, String charset)
  9. putTriByte(ByteBuffer buf, int value)