Code example for ByteBuffer

Methods: rewind

0
        if ((i + 1) == noOfValues) {
            bb = encoder.encode(CharBuffer.wrap(next));
        } else { 
            bb = encoder.encode(CharBuffer.wrap(next + '\0'));
        } 
        bb.rewind();
        return bb;
    } 
 
    /** 
     * Write String in UTF-LEBOM format 
     * <p/> 
     * When this is called multiple times, all but the last value has a trailing null 
     * <p/> 
     * Remember we are using this charset because the charset that writes BOM does it the wrong way for us 
     * so we use this none and then manually add the BOM ourselves. 
     * 
     * @param next 
     * @param i 
     * @param noOfValues 
     * @return