Examples of Decoder


Examples of com.peterhi.working.Decoder

    enc.close();
   
    System.out.println("BAOS size = " + baos.size());
   
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    Decoder dec = new Decoder(bais);
    Person j = dec.decode();
    dec.close();
    System.out.println(bais.available());
    System.out.println(j.getSpouse().getName());
  }
View Full Code Here

Examples of com.twitter.hpack.Decoder

    public DefaultHttp2HeadersDecoder() {
        this(DEFAULT_MAX_HEADER_SIZE, DEFAULT_HEADER_TABLE_SIZE);
    }

    public DefaultHttp2HeadersDecoder(int maxHeaderSize, int maxHeaderTableSize) {
        decoder = new Decoder(maxHeaderSize, maxHeaderTableSize);
    }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.videosharing.decode.Decoder

    protected void updateStatusbar() {
        VideoSharingSession session = videoSharingSessionObservable.getValue();
        if (session == null)
            return;

        Decoder decoder = session.getDecoder();
        if (decoder == null)
            return;

        DecodingStatisticPacket statistic = decoder.getLastDecodingStatistic();
        if (statistic == null || statistic == lastShownStatus)
            return;

        lastShownStatus = statistic;
View Full Code Here

Examples of edu.cmu.pocketsphinx.Decoder

        Config c = Decoder.defaultConfig();
        c.setFloat("-samprate", 8000);
        c.setString("-hmm", "../../model/hmm/en_US/hub4wsj_sc_8k");
        c.setString("-lm", "../../model/lm/en_US/hub4.5000.DMP");
        c.setString("-dict", "../../model/lm/en_US/hub4.5000.dic");
        Decoder d = new Decoder(c);
        AudioInputStream ais = null;
        try {
            URL testwav = new URL("file:../../test/data/wsj/n800_440c0207.wav");
            AudioInputStream tmp = AudioSystem.getAudioInputStream(testwav);
            // Convert it to the desired audio format for PocketSphinx.
            AudioFormat targetAudioFormat =
                new AudioFormat((float)c.getFloat("-samprate"),
                                16, 1, true, true);
            ais = AudioSystem.getAudioInputStream(targetAudioFormat, tmp);
        } catch (IOException e) {
            fail("Failed to open " + e.getMessage());
        } catch (UnsupportedAudioFileException e) {
            fail("Unsupported file type of " + e.getMessage());
        }

        d.startUtt("");
        byte[] b = new byte[4096];
        try {
            int nbytes;
            while ((nbytes = ais.read(b)) >= 0) {
                ByteBuffer bb = ByteBuffer.wrap(b, 0, nbytes);
                short[] s = new short[nbytes/2];
                bb.asShortBuffer().get(s);
                d.processRaw(s, nbytes/2, false, false);
            }
        } catch (IOException e) {
            fail("Error when reading goforward.wav" + e.getMessage());
        }
        d.endUtt();
        System.out.println(d.hyp().getHypstr());
       
        for (Segment seg : d.seg()) {
          System.out.println(seg.getWord());
        }
    }
View Full Code Here

Examples of feign.codec.Decoder

    MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("success!"));
    server.play();

    String url = "http://localhost:" + server.getPort();
    Decoder decoder = new Decoder() {
      @Override
      public Object decode(Response response, Type type) {
        return "fail";
      }
    };
View Full Code Here

Examples of fr.imag.adele.apam.declarations.encoding.Decoder

     
        /*
         *  Parse metadata to get APAM core declaration
         */
    try {
      Decoder parser = new MetadataParser(this);
      this.declaration = parser.decode(m_componentMetadata,this);

    } catch (Exception e) {
      e.printStackTrace();
      this.declaration    = null;
      this.declarationError   = new ConfigurationException(e.getLocalizedMessage());
View Full Code Here

Examples of fr.jayasoft.crypto.decoder.Decoder

    public void doTestAlgo(String algo) {
      System.out.println("Testing: " + algo);
        Crypto c = CryptoFactory.get(algo);
        KeyGenerator kg = c.getKeyGenerator();
        Encoder e = c.newEncoder(kg.getEncodingKey());
        Decoder d = c.newDecoder(kg.getDecodingKey());
       
        encodeDecodeProperties(e,d);
    }
View Full Code Here

Examples of javax.websocket.Decoder

            return decodePrimitive(targetType, message);
        }
        List<InstanceHandle<? extends Decoder>> decoders = textDecoders.get(targetType);
        if (decoders != null) {
            for (InstanceHandle<? extends Decoder> decoderHandle : decoders) {
                Decoder decoder = decoderHandle.getInstance();
                if (decoder instanceof Decoder.Text) {
                    if (((Decoder.Text) decoder).willDecode(message)) {
                        return ((Decoder.Text) decoder).decode(message);
                    }
                } else {
View Full Code Here

Examples of javax.websocket.Decoder

    public Object decodeBinary(final Class<?> targetType, final byte[] bytes) throws DecodeException {
        List<InstanceHandle<? extends Decoder>> decoders = binaryDecoders.get(targetType);
        if (decoders != null) {
            for (InstanceHandle<? extends Decoder> decoderHandle : decoders) {
                Decoder decoder = decoderHandle.getInstance();
                if (decoder instanceof Decoder.Binary) {
                    if (((Decoder.Binary) decoder).willDecode(ByteBuffer.wrap(bytes))) {
                        return ((Decoder.Binary) decoder).decode(ByteBuffer.wrap(bytes));
                    }
                } else {
View Full Code Here

Examples of javax.websocket.Decoder

            return decodePrimitive(targetType, message);
        }
        List<InstanceHandle<? extends Decoder>> decoders = textDecoders.get(targetType);
        if (decoders != null) {
            for (InstanceHandle<? extends Decoder> decoderHandle : decoders) {
                Decoder decoder = decoderHandle.getInstance();
                if (decoder instanceof Decoder.Text) {
                    if (((Decoder.Text) decoder).willDecode(message)) {
                        return ((Decoder.Text) decoder).decode(message);
                    }
                } else {
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.