Examples of HproseException


Examples of hprose.common.HproseException

        }
        return castError(o, type);
    }

    private Object castError(String srctype, Class desttype) throws IOException {
        throw new HproseException(srctype + " can't change to " + desttype.getName());
    }
View Full Code Here

Examples of hprose.common.HproseException

    private Object castError(String srctype, Class desttype) throws IOException {
        throw new HproseException(srctype + " can't change to " + desttype.getName());
    }

    private Object castError(Object obj, Class type) throws IOException {
        throw new HproseException(obj.getClass().getName() + " can't change to " + type.getName());
    }
View Full Code Here

Examples of hprose.common.HproseException

                break;
            case HproseTags.TagError:
                readRaw(ostream);
                break;
            case -1:
                throw new HproseException("No byte found in stream");
            default:
                throw new HproseException("Unexpected serialize tag '" +
                        (char) tag + "' in stream");
        }
    }
View Full Code Here

Examples of hprose.common.HproseException

                ostream.write(stream.read());
                ostream.write(stream.read());
                break;
            }
            default:
                throw new HproseException("bad utf-8 encoding at " +
                                          ((tag < 0) ? "end of stream" :
                                              "0x" + Integer.toHexString(tag & 0xff)));
        }
    }
View Full Code Here

Examples of hprose.common.HproseException

                        break;
                    }
                // no break here!! here need throw exception.
                }
                default:
                    throw new HproseException("bad utf-8 encoding at " +
                                              ((tag < 0) ? "end of stream" :
                                                  "0x" + Integer.toHexString(tag & 0xff)));
            }
        }
        ostream.write(stream.read());
View Full Code Here

Examples of hprose.common.HproseException

        }
        else if (obj instanceof Object[]) {
            writeArray((Object[]) obj, true);
        }
        else if (!(obj instanceof Serializable)) {
            throw new HproseException(obj.getClass().getName() + " is not a serializable type");
        }
        else if (obj.getClass().isArray()) {
            writeArray(obj, true);
        }
        else if (obj instanceof ArrayList ||
View Full Code Here

Examples of hprose.common.HproseException

    public void writeEnum(Object obj) throws IOException  {
        try {
            writeInteger(((Integer) HproseHelper.enumOrdinal.get(obj)).intValue());
        }
        catch (IllegalAccessException e) {
            throw new HproseException(e.getMessage());
        }
    }
View Full Code Here

Examples of hprose.common.HproseException

                        stream.write(0x80 | ((c >>> 12) & 0x3f));
                        stream.write(0x80 | ((c >>> 6) & 0x3f));
                        stream.write(0x80 | (c & 0x3f));
                    }
                    else {
                        throw new HproseException("wrong unicode string");
                    }
                }
                else {
                    throw new HproseException("wrong unicode string");
                }
            }
        }
        stream.write(HproseTags.TagQuote);
    }
View Full Code Here

Examples of hprose.common.HproseException

                        stream.write(0x80 | ((c >>> 12) & 0x3f));
                        stream.write(0x80 | ((c >>> 6) & 0x3f));
                        stream.write(0x80 | (c & 0x3f));
                    }
                    else {
                        throw new HproseException("wrong unicode string");
                    }
                }
                else {
                    throw new HproseException("wrong unicode string");
                }
            }
        }
        stream.write(HproseTags.TagQuote);
    }
View Full Code Here

Examples of hprose.common.HproseException

                    Object value;
                    try {
                        value = ((Field) ((Entry) iter.next()).getValue()).get(object);
                    }
                    catch (Exception e) {
                        throw new HproseException(e.getMessage());
                    }
                    serialize(value);
                }
            }
            else {
                for (Iterator iter = members.entrySet().iterator(); iter.hasNext();) {
                    Object value;
                    try {
                        value = ((PropertyAccessor) ((Entry) iter.next()).getValue()).getter.invoke(object, nullArgs);
                    }
                    catch (Exception e) {
                        throw new HproseException(e.getMessage());
                    }
                    serialize(value);
                }
            }
            stream.write(HproseTags.TagClosebrace);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.