Package hprose.common

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


                        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

                        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

                    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

                    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

        }
        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

                        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

                        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

                        bytestream.write(HproseTags.TagError);
                        hproseReader.readRaw(bytestream);
                    }
                    else {
                        hproseReader.reset();
                        result = new HproseException((String) hproseReader.readString());
                    }
                    break;
            }
        }
        if (resultMode == HproseResultMode.RawWithEndTag || resultMode == HproseResultMode.Raw) {
View Full Code Here

            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

TOP

Related Classes of hprose.common.HproseException

Copyright © 2018 www.massapicom. 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.