Code example for Charset

Methods: newDecoder

0
		this.value = value;
		version = fresh ? rand.nextInt() : 0;
	} 
 
	public Value(ByteBuffer in) throws CharacterCodingException {
		String[] raw = CHARSET.newDecoder().decode(in).toString().split(DELIMITER, 2);
		version = Integer.parseInt(raw[1]);
		value = raw[0];
	} 
 
	public byte[] hash() { 
		return BigInteger.valueOf(version ^ value.hashCode()).toByteArray();
	} 
 
	public ByteBuffer toByteBuffer() {
		String s = value + DELIMITER + version;
		return ByteBuffer.wrap(s.getBytes(CHARSET));
	} 
 
	@Override 
	public String toString() {