Beispiel #1
0
        protected override java.nio.charset.CoderResult decodeLoop(java.nio.ByteBuffer inJ, java.nio.CharBuffer outJ)
        {
            Encoding enc = this.cs.getEncoding();

            byte[] input = new byte[inJ.remaining()];
            inJ.get(input);
            char[] output = new char[input.Length * CharsetEncoderImpl.fiveValue];
            int    size   = enc.GetDecoder().GetChars(input, 0, input.Length, output, 0, true);

            outJ.put(output, 0, size);
            return(java.nio.charset.CoderResult.UNDERFLOW);
        }
Beispiel #2
0
 /**
  * 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);
     }
 }