protected String read()
    {
        StringBuffer buffer = new StringBuffer();
        int codePoint;

        try
        {
            //debug("start read");
            for (int i = 0; i < 4; i++)
            {
                codePoint = this.socketIn.read();
                if (codePoint == 0)
                {
                    String nulls = new String(ChannelServer.NULLBYTE);
                    buffer.append(nulls);
                }
                else
                {
                    if (Character.isValidCodePoint(codePoint))
                    {
                        buffer.appendCodePoint(codePoint);
                    }
                }
            }
            int plen = func.bytetoint(buffer.toString().substring(2), 2);

            if (plen > 1)
            {

                for (int i = 0; i < plen; i++)
                {
                    codePoint = this.socketIn.read();
                    if (codePoint == 0)
                    {
                        String nulls = new String(ChannelServer.NULLBYTE);
                        buffer.append(nulls);
                    }
                    else
                    {
                        if (Character.isValidCodePoint(codePoint))
                        {
                            buffer.appendCodePoint(codePoint);
                        }
                    }
                }
                //debug("end read");
            }
        } catch (Exception e)
        {
            debug("Error (read): " + e.getMessage());
            this.server.remove(this.getRemoteAddress());
            return null;
        }

        return buffer.toString();
    }