Here you can find the source of getString(ByteBuffer buf)
Parameter | Description |
---|---|
buf | The buffer. |
public static String getString(ByteBuffer buf)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { /**/* w ww. j a v a 2 s . c om*/ * Gets an RS2 string from the buffer. * @param buf The buffer. * @return The RS2 string. */ public static String getString(ByteBuffer buf) { StringBuilder bldr = new StringBuilder(); char c; while ((c = (char) buf.get()) != 10) { bldr.append(c); } return bldr.toString(); } }