public static ByteBuffer toBuffer(String value)
	{
		if (value == null || value.length() == 0) {
			return EMPTY;
		}
		
		ByteBuffer buffer = factory.allocate(value.length());
		char[] chars = value.toCharArray();
		
		// Convert from chars to bytes
		for (int i = 0; i < chars.length; i++) {
			buffer.put((byte)chars[i]);
		}
		buffer.flip();
		
		return buffer;
	}