⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagestring.java

📁 一个简单的visio程序。
💻 JAVA
字号:

package servlet.http;

import java.io.IOException;
import javax.servlet.ServletOutputStream;
import servlet.util.Ascii;

// Referenced classes of package servlet.http:
//            MessageBytes, HttpDate

public class MessageString extends MessageBytes
{

    public MessageString()
    {
    }

    public MessageString(String s)
    {
        str = s;
    }

    public MessageString(byte abyte0[], int i, int j)
    {
        super(abyte0, i, j);
    }

    public void reset()
    {
        super.reset();
        str = null;
    }

    public void setString(String s)
    {
        super.reset();
        str = s;
    }

    public void setBytes(byte abyte0[], int i, int j)
    {
        super.setBytes(abyte0, i, j);
        str = null;
    }

    public boolean isSet()
    {
        return str != null || super.isSet();
    }

    public int getBytes(byte abyte0[], int i)
    {
        if(str != null)
        {
            int j = str.length();
            str.getBytes(0, j, abyte0, i);
            return j;
        }
        else
        {
            return super.getBytes(abyte0, i);
        }
    }

    public String toString()
    {
        if(str != null)
            return str;
        else
            return super.toString();
    }

    public int toInteger()
        throws NumberFormatException
    {
        if(str != null)
            return Integer.parseInt(str);
        else
            return super.toInteger();
    }

    public long toDate(HttpDate httpdate)
        throws IllegalArgumentException
    {
        if(str != null)
        {
            httpdate.parse(str);
            return httpdate.getTime();
        }
        else
        {
            return super.toDate(httpdate);
        }
    }

    public boolean equals(String s)
    {
        if(str != null)
            return str.equals(s);
        else
            return super.equals(s);
    }

    public boolean equalsIgnoreCase(String s)
    {
        if(str != null)
            return str.equalsIgnoreCase(s);
        else
            return super.equalsIgnoreCase(s);
    }

    public boolean equals(byte abyte0[], int i, int j)
    {
        if(str != null)
        {
            String s = str;
            if(j != s.length())
                return false;
            for(int k = 0; k < j; k++)
                if(abyte0[i++] != s.charAt(k))
                    return false;

            return true;
        }
        else
        {
            return super.equals(abyte0, i, j);
        }
    }

    public boolean equalsIgnoreCase(byte abyte0[], int i, int j)
    {
        if(str != null)
        {
            String s = str;
            if(j != s.length())
                return false;
            for(int k = 0; k < j; k++)
                if(Ascii.toLower(abyte0[i++]) != Ascii.toLower(s.charAt(k)))
                    return false;

            return true;
        }
        else
        {
            return super.equalsIgnoreCase(abyte0, i, j);
        }
    }

    public boolean startsWith(String s)
    {
        if(str != null)
            return str.startsWith(s);
        else
            return super.startsWith(s);
    }

    public void write(ServletOutputStream servletoutputstream)
        throws IOException
    {
        if(str != null)
        {
            servletoutputstream.print(str);
            return;
        }
        else
        {
            super.write(servletoutputstream);
            return;
        }
    }

    public int length()
    {
        if(str != null)
            return str.length();
        else
            return super.length();
    }

    protected String str;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -