Here you can find the source of toTextAll(ByteBuffer bytes)
Parameter | Description |
---|---|
bytes | Source byte buffer. |
public static String toTextAll(ByteBuffer bytes)
//package com.java2s; /*//from w w w . jav a 2 s . c om * WireSpider * * Copyright (c) 2015 kazyx * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ import java.nio.ByteBuffer; import java.nio.charset.Charset; public class Main { private static final Charset UTF8 = Charset.forName("UTF-8"); /** * Convert whole byte buffer to UTF-8 String. * * @param bytes Source byte buffer. * @return String expression of the bytes. */ public static String toTextAll(ByteBuffer bytes) { return new String(bytes.array(), UTF8); } }