Package javax.websocket

Examples of javax.websocket.DecodeException


        {
            return new SimpleDateFormat("yyyy.MM.dd").parse(s);
        }
        catch (ParseException e)
        {
            throw new DecodeException(s,e.getMessage(),e);
        }
    }
View Full Code Here


        {
            int id = bytes.get(bytes.position());
            if (id != FruitBinaryEncoder.FRUIT_ID_BYTE)
            {
                // not a binary fruit object
                throw new DecodeException(bytes,"Not an encoded Binary Fruit object");
            }

            Fruit fruit = new Fruit();
            fruit.name = getUTF8String(bytes);
            fruit.color = getUTF8String(bytes);
            return fruit;
        }
        catch (BufferUnderflowException e)
        {
            throw new DecodeException(bytes,"Unable to read Fruit from binary message",e);
        }
    }
View Full Code Here

    {
        Pattern pat = Pattern.compile("([^|]*)|([^|]*)");
        Matcher mat = pat.matcher(s);
        if (!mat.find())
        {
            throw new DecodeException(s,"Unable to find Fruit reference encoded in text message");
        }

        Fruit fruit = new Fruit();
        fruit.name = mat.group(1);
        fruit.color = mat.group(2);
View Full Code Here

        {
            return new SimpleDateFormat("HH:mm:ss z").parse(s);
        }
        catch (ParseException e)
        {
            throw new DecodeException(s,e.getMessage(),e);
        }
    }
View Full Code Here

        {
            return Double.parseDouble(s);
        }
        catch (NumberFormatException e)
        {
            throw new DecodeException(s,"Unable to parse double",e);
        }
    }
View Full Code Here

        {
            return Long.parseLong(s);
        }
        catch (NumberFormatException e)
        {
            throw new DecodeException(s,"Unable to parse Long",e);
        }
    }
View Full Code Here

        {
            return Integer.parseInt(s);
        }
        catch (NumberFormatException e)
        {
            throw new DecodeException(s,"Unable to parse Integer",e);
        }
    }
View Full Code Here

        {
            return Byte.parseByte(s);
        }
        catch (NumberFormatException e)
        {
            throw new DecodeException(s,"Unable to parse Byte",e);
        }
    }
View Full Code Here

        try
        {
            Float val = Float.parseFloat(s);
            if (val.isNaN())
            {
                throw new DecodeException(s,"NaN");
            }
            return val;
        }
        catch (NumberFormatException e)
        {
            throw new DecodeException(s,"Unable to parse float",e);
        }
    }
View Full Code Here

        {
            return Short.parseShort(s);
        }
        catch (NumberFormatException e)
        {
            throw new DecodeException(s,"Unable to parse Short",e);
        }
    }
View Full Code Here

TOP

Related Classes of javax.websocket.DecodeException

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.