int nbytes = buf.remaining();
int nbytes = buf.limit();
	private static void work(MessageDigest digest, String s, CharsetEncoder encoder) {		try {			CharBuffer cbuf = CharBuffer.allocate(s.length());			cbuf.append(s);			ByteBuffer buf = encoder.encode(cbuf);			int nbytes = buf.remaining();			byte[] encodedBytes = new byte[nbytes];			buf.get(encodedBytes);			digest.update(encodedBytes);		} catch (CharacterCodingException e) {			// This should never happen, since we're encoding to UTF-8.		}	}