Ejemplo n.º 1
0
 public String toString() {
   final StringBuffer buffer = new StringBuffer();
   buffer.append("SVNCharsetConvertor");
   buffer.append("[from=").append(myDecoder.charset().displayName());
   buffer.append(", to=").append(myEncoder.charset().displayName());
   buffer.append(']');
   return buffer.toString();
 }
Ejemplo n.º 2
0
 @JRubyMethod
 public IRubyObject inspect(ThreadContext context) {
   return RubyString.newString(
       context.runtime,
       "#<Encoding::Converter: "
           + srcDecoder.charset().name()
           + " to "
           + destEncoder.charset().name());
 }
Ejemplo n.º 3
0
 /** @tests java.io.InputStreamReader(java.io.InputStream, java.nio.charset.CharsetDecoder) */
 public void test_ConstructorLjava_io_InputStreamLjava_nio_charset_CharsetDecoder()
     throws IOException {
   CharsetDecoder decoder = Charset.forName("utf-8").newDecoder();
   try {
     reader = new InputStreamReader(null, decoder);
     fail();
   } catch (NullPointerException e) {
     // Expected
   }
   try {
     reader = new InputStreamReader(in, (CharsetDecoder) null);
     fail();
   } catch (NullPointerException e) {
     // Expected
   }
   InputStreamReader reader2 = new InputStreamReader(in, decoder);
   assertEquals(Charset.forName(reader2.getEncoding()), decoder.charset());
   reader2.close();
 }