コード例 #1
0
ファイル: SVNCharsetConvertor.java プロジェクト: madcap99/OVC
 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();
 }
コード例 #2
0
 @JRubyMethod
 public IRubyObject inspect(ThreadContext context) {
   return RubyString.newString(
       context.runtime,
       "#<Encoding::Converter: "
           + srcDecoder.charset().name()
           + " to "
           + destEncoder.charset().name());
 }
コード例 #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();
 }