Examples of HproseException


Examples of hprose.common.HproseException

                    else {
                        value = ((PropertyAccessor) member).getter.invoke(object, nullArgs);
                    }
                }
                catch (Exception e) {
                    throw new HproseException(e.getMessage());
                }
                serialize(value);
            }
            stream.write(HproseTags.TagClosebrace);
        }
View Full Code Here

Examples of hprose.common.HproseException

        }
        else if (obj instanceof Serializable) {
            writeObject((Serializable)obj, true);
        }
        else {
            throw new HproseException(obj.getClass().getName() + " is not a serializable type");
        }
    }
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

            case HproseTags.TagObject:
                return readObject(false, type);
            case HproseTags.TagRef:
                return readRef(type);
            case HproseTags.TagError:
                throw new HproseException((String)readString());
            case -1:
                throw new HproseException("No byte found in stream");
        }
        throw new HproseException("Unexpected serialize tag '" +
                                  (char) tag + "' in stream");
    }
View Full Code Here

Examples of hprose.common.HproseException

        return castError("Character", type);
    }

    public void checkTag(int expectTag, int tag) throws IOException {
        if (tag != expectTag) {
            throw new HproseException("Tag '" + (char) expectTag +
                                      "' expected, but '" + (char) tag +
                                      "' found in stream");
        }
    }
View Full Code Here

Examples of hprose.common.HproseException

        checkTag(expectTag, stream.read());
    }

    public int checkTags(String expectTags, int tag) throws IOException {
        if (expectTags.indexOf(tag) == -1) {
            throw new HproseException("Tag '" + expectTags +
                                      "' expected, but '" + (char) tag +
                                      "' found in stream");
        }
        return tag;
    }
View Full Code Here

Examples of hprose.common.HproseException

        try {
            Object o = HproseHelper.getEnumConstants.invoke(type, nullArgs);
            return Array.get(o, value);
        }
        catch (IllegalAccessException e) {
            throw new HproseException(e.getMessage());
        }
        catch (IllegalArgumentException e) {
            throw new HproseException(e.getMessage());
        }
        catch (InvocationTargetException e) {
            throw new HproseException(e.getMessage());
        }
    }
View Full Code Here

Examples of hprose.common.HproseException

                           ((c2 & 0x3f) << 6) |
                            (c3 & 0x3f));
                break;
            }
            default:
                throw new HproseException("bad utf-8 encoding at " +
                                          ((c < 0) ? "end of stream" : "0x" + Integer.toHexString(c & 0xff)));
        }
        return u;
    }
View Full Code Here

Examples of hprose.common.HproseException

                        }
                    }
                // no break here!! here need throw exception.
                }
                default:
                    throw new HproseException("bad utf-8 encoding at " +
                                              ((c < 0) ? "end of stream" : "0x" + Integer.toHexString(c & 0xff)));
            }
        }
        checkTag(HproseTags.TagQuote);
        Object o = changeStringType(buf, type);
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.