Don't support other encodings than UTF-8 emul
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sun, 30 Sep 2012 17:17:00 -0700
branchemul
changeset 74462dbda65533
parent 73 bf8e571de593
child 75 5a8dca9ffc5c
Don't support other encodings than UTF-8
emul/src/main/java/java/lang/String.java
     1.1 --- a/emul/src/main/java/java/lang/String.java	Sun Sep 30 17:12:18 2012 -0700
     1.2 +++ b/emul/src/main/java/java/lang/String.java	Sun Sep 30 17:17:00 2012 -0700
     1.3 @@ -433,17 +433,17 @@
     1.4       *
     1.5       * @since  JDK1.1
     1.6       */
     1.7 -    public String(byte bytes[], int offset, int length, String charsetName)
     1.8 -        throws UnsupportedEncodingException
     1.9 -    {
    1.10 -        if (charsetName == null)
    1.11 -            throw new NullPointerException("charsetName");
    1.12 -        checkBounds(bytes, offset, length);
    1.13 -        char[] v = StringCoding.decode(charsetName, bytes, offset, length);
    1.14 -        this.offset = 0;
    1.15 -        this.count = v.length;
    1.16 -        this.value = v;
    1.17 -    }
    1.18 +//    public String(byte bytes[], int offset, int length, String charsetName)
    1.19 +//        throws UnsupportedEncodingException
    1.20 +//    {
    1.21 +//        if (charsetName == null)
    1.22 +//            throw new NullPointerException("charsetName");
    1.23 +//        checkBounds(bytes, offset, length);
    1.24 +//        char[] v = StringCoding.decode(charsetName, bytes, offset, length);
    1.25 +//        this.offset = 0;
    1.26 +//        this.count = v.length;
    1.27 +//        this.value = v;
    1.28 +//    }
    1.29  
    1.30      /**
    1.31       * Constructs a new {@code String} by decoding the specified subarray of
    1.32 @@ -510,11 +510,11 @@
    1.33       *
    1.34       * @since  JDK1.1
    1.35       */
    1.36 -    public String(byte bytes[], String charsetName)
    1.37 -        throws UnsupportedEncodingException
    1.38 -    {
    1.39 -        this(bytes, 0, bytes.length, charsetName);
    1.40 -    }
    1.41 +//    public String(byte bytes[], String charsetName)
    1.42 +//        throws UnsupportedEncodingException
    1.43 +//    {
    1.44 +//        this(bytes, 0, bytes.length, charsetName);
    1.45 +//    }
    1.46  
    1.47      /**
    1.48       * Constructs a new {@code String} by decoding the specified array of
    1.49 @@ -942,12 +942,12 @@
    1.50       *
    1.51       * @since  JDK1.1
    1.52       */
    1.53 -    public byte[] getBytes(String charsetName)
    1.54 -        throws UnsupportedEncodingException
    1.55 -    {
    1.56 -        if (charsetName == null) throw new NullPointerException();
    1.57 -        return StringCoding.encode(charsetName, value, offset, count);
    1.58 -    }
    1.59 +//    public byte[] getBytes(String charsetName)
    1.60 +//        throws UnsupportedEncodingException
    1.61 +//    {
    1.62 +//        if (charsetName == null) throw new NullPointerException();
    1.63 +//        return StringCoding.encode(charsetName, value, offset, count);
    1.64 +//    }
    1.65  
    1.66      /**
    1.67       * Encodes this {@code String} into a sequence of bytes using the given