Examples of DecodingException


Examples of api.exceptions.DecodingException

    }

    private <T> T tryDecode(InputStream data, Class<T> objClass) throws InstantiationException, IllegalAccessException, InvocationTargetException, DecodingException {
        int constructorCode = objClass.getAnnotation(Constructor.class).value();
        if(constructorCode != integerDecoder.decode(data)) {
            throw new DecodingException("Another object was received");
        }
        T obj = objClass.newInstance();
        Field[] fields = objClass.getDeclaredFields();
        for(Field field: fields) {
            Decoder decoder = lookupDecoder(field);
View Full Code Here

Examples of de.fu_berlin.inf.dpp.videosharing.exceptions.DecodingException

                    .getStreamCoder();
                if (newCoder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO) {
                    videoStreamIndex = streamIndex;
                    coder = newCoder;
                    if ((errorNumber = coder.open()) < 0) {
                        videoSharingSession.reportError(new DecodingException(
                            IError.make(errorNumber).getDescription()));
                        return;
                    }
                }
                if (coder == null)
                    // coder not properly set up yet
                    continue;
            }

            if (packet.getStreamIndex() == videoStreamIndex) {
                // one of the pictures in this packet
                IVideoPicture picture = IVideoPicture.make(
                    coder.getPixelType(), coder.getWidth(), coder.getHeight());

                // offset for already processed data in package
                int offset = 0;
                // fetch every frame from the packet
                while (offset < packet.getSize()) {
                    int bytesDecoded = coder.decodeVideo(picture, packet,
                        offset);

                    if (bytesDecoded < 0) {
                        videoSharingSession.reportError(new DecodingException(
                            IError.make(bytesDecoded).getDescription()));
                        return;
                    }

                    offset += bytesDecoded;
View Full Code Here

Examples of org.apache.james.imap.decode.DecodingException

        } else if (nextWord.equalsIgnoreCase(ImapConstants.STATUS_UIDVALIDITY)) {
            items.setUidValidity(true);
        } else if (nextWord.equalsIgnoreCase(ImapConstants.STATUS_UNSEEN)) {
            items.setUnseen(true);
        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown status item: '" + nextWord + "'");
        }
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

    }

    private void mustBeS(CharSequence sectionSpecification, int position) throws DecodingException {
        final char next = sectionSpecification.charAt(position);
        if (!(next == 's' || next == 'S')) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

    }

    private void mustBeDot(CharSequence sectionSpecification, int position) throws DecodingException {
        final char next = sectionSpecification.charAt(position);
        if (!(next == '.')) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

    }

    private void mustBeOpenParen(CharSequence sectionSpecification, int position) throws DecodingException {
        final char next = sectionSpecification.charAt(position);
        if (!(next == '(')) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

                result = HEADER;
            } else {
                result = headerFields(at + 6, sectionSpecification);
            }
        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
        return result;
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

                    mustBeO(sectionSpecification, at + 9);
                    mustBeT(sectionSpecification, at + 10);
                    result = HEADER_NOT_FIELDS;
                    namesStartAt = skipSpaces(at + 11, sectionSpecification);
                } else {
                    throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
                }
                break;
            default:
                throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
            }
            mustBeOpenParen(sectionSpecification, namesStartAt);
            readHeaderNames(namesStartAt + 1, sectionSpecification);

        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
        return result;
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

                break;
            default:
                readHeaderNames(at + 1, lastWordStart, sectionSpecification);
            }
        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Closing parenthesis missing.");
        }
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

            mustBeE(sectionSpecification, at + 1);
            mustBeX(sectionSpecification, at + 2);
            mustBeT(sectionSpecification, at + 3);
            storePartial();
        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
        return TEXT;
    }
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.