code:     public void doHarmonyDecoder(byte[] src, boolean errorExpected,
              int failPosExpected) {
          CharsetDecoder decoder = new Utf8Decoder();
  
          ByteBuffer bb = ByteBuffer.allocate(src.length);
          CharBuffer cb = CharBuffer.allocate(bb.limit());
  
          boolean error = false;
          int i = 0;
          for (; i < src.length; i++) {
              bb.put(src[i]);
              bb.flip();
              CoderResult cr = decoder.decode(bb, cb, false);
              if (cr.isError()) {
                  error = true;
                  break;
              }
              bb.compact();
          }
  
          assertEquals(Boolean.valueOf(errorExpected), Boolean.valueOf(error));
          assertEquals(failPosExpected, i);
      }
  