protected override java.nio.charset.CoderResult encodeLoop(java.nio.CharBuffer inJ, java.nio.ByteBuffer outJ) { Encoding enc = this.cs.getEncoding(); char[] input = new char[inJ.capacityJ-inJ.positionJ]; inJ.get(input); byte[] output = new byte[input.Length * fiveValue]; int size = enc.GetEncoder().GetBytes(input, 0, input.Length, output, 0, true); outJ.put(output, 0, size); outJ = java.nio.ByteBuffer.wrap((byte[])outJ.array(), 0, size); return java.nio.charset.CoderResult.UNDERFLOW; }
/** * Updates this {@code MessageDigestSpi} using the given {@code input}. * * @param input * the {@code ByteBuffer}. */ protected internal virtual void engineUpdate(java.nio.ByteBuffer input) { if (!input.hasRemaining()) { return; } byte[] tmp; if (input.hasArray()) { tmp = (byte[])input.array(); int offset = input.arrayOffset(); int position = input.position(); int limit = input.limit(); engineUpdate(tmp, offset + position, limit - position); input.position(limit); } else { tmp = new byte[input.limit() - input.position()]; input.get(tmp); engineUpdate(tmp, 0, tmp.Length); } }