Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Date: 2013apr28 Language: Java Class: NIO Q. How do I convert a ByteBuffer to a String? A. Use the 4-parameter constructor of Stringint bytesRead = sc.read(bb); String reply = new String(bb.array(), 0, bytesRead, "UTF-8");
Add a commentSign in to add a comment