/[classpath]/classpath/java/nio/charset/Charset.java
ViewVC logotype

Diff of /classpath/java/nio/charset/Charset.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by rveldema, Tue Mar 12 11:36:22 2002 UTC revision 1.4 by rveldema, Mon Apr 8 10:14:49 2002 UTC
# Line 5  import java.nio.*; Line 5  import java.nio.*;
5    
6  public class Charset  public class Charset
7  {  {
8      static Charset forName(String name)      public static Charset forName(String name)
9      {      {
10          return new Charset();          return new Charset();
11      }      }
12    
13      CharsetDecoder newDecoder()      public CharsetDecoder newDecoder()
14      {        {  
15          return new CharsetDecoder(this,2,2)          return new CharsetDecoder(this,2,2)
16              {              {
# Line 27  public class Charset Line 27  public class Charset
27              };              };
28      }      }
29    
30      CharsetEncoder newEncoder()      public CharsetEncoder newEncoder()
31      {                {          
32          return new CharsetEncoder(this,2,2)          return new CharsetEncoder(this,2,2)
33              {              {
34                  protected CoderResult encodeLoop(CharBuffer  in,                  protected CoderResult encodeLoop(CharBuffer  in,
35                                                   ByteBuffer  out)                                                   ByteBuffer  out)
36                  {                  {
37                        //System.out.println("in encode loop:"+in.hasRemaining());
38    
39                      while (in.hasRemaining())                      while (in.hasRemaining())
40                          {                          {
41                              char a = in.get();                              char a = in.get();
42                              out.put((byte)a);                              out.put((byte)a);
43    
44                              //int len = out.position();                              //int len = out.position();
45                              //System.out.println("pos="+len);                              //System.out.println("pos="+len + ","+a);
46                          }                          }
47                      return null;                      return null;
48                  }                  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26