Examples of DecoderFactory


Examples of org.apache.avro.io.DecoderFactory

      }
   }

   @Override
   public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException {
      DecoderFactory factory = new DecoderFactory(); // TODO: Could this be cached?
      InputStream is = new ByteArrayInputStream(buf, offset, length);
      Decoder decoder = factory.createBinaryDecoder(is, null);
      return objectFromByteBuffer(decoder);
   }
View Full Code Here

Examples of org.apache.avro.io.DecoderFactory

    dump(bs);
    Assert.assertEquals(12, bs.length);

    ByteArrayInputStream bais = new ByteArrayInputStream(bs);
    ReflectDatumReader<A> reader = new ReflectDatumReader<A>(schm);
    BinaryDecoder dec = (new DecoderFactory()).createBinaryDecoder(bais, null);
    A decoded = reader.read(null, dec);
    LOG.info(decoded);
  }
View Full Code Here

Examples of org.apache.avro.io.DecoderFactory

    Assert.assertEquals(60, bs.length);

    ByteArrayInputStream bais = new ByteArrayInputStream(bs);
    ReflectDatumReader<EventImpl> reader = new ReflectDatumReader<EventImpl>(
        schm);
    BinaryDecoder dec = (new DecoderFactory()).createBinaryDecoder(bais, null);
    EventImpl decoded = reader.read(null, dec);
    // EventImpl decoded = reader.read(null, new BinaryDecoder(bais));
    LOG.info(decoded);
  }
View Full Code Here

Examples of org.apache.avro.io.DecoderFactory

      }
   }

   @Override
   public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException {
      DecoderFactory factory = new DecoderFactory(); // TODO: Could this be cached?
      InputStream is = new ByteArrayInputStream(buf, offset, length);
      Decoder decoder = factory.createBinaryDecoder(is, null);
      return objectFromByteBuffer(decoder);
   }
View Full Code Here

Examples of org.apache.directory.server.kerberos.shared.io.decoder.DecoderFactory

        if ( clazz == null )
        {
            throw new IOException( I18n.err( I18n.ERR_600, encodable ) );
        }

        DecoderFactory factory = null;

        try
        {
            factory = ( DecoderFactory ) clazz.newInstance();
        }
        catch ( IllegalAccessException iae )
        {
            throw new IOException( I18n.err( I18n.ERR_601, encodable ) );
        }
        catch ( InstantiationException ie )
        {
            throw new IOException( I18n.err( I18n.ERR_602, encodable ) );
        }

        Decoder decoder = factory.getDecoder();

        return decoder.decode( plainText );
    }
View Full Code Here

Examples of org.apache.directory.server.kerberos.shared.io.decoder.DecoderFactory

        if ( clazz == null )
        {
            throw new IOException( "Decoder unavailable for " + encodable );
        }

        DecoderFactory factory = null;

        try
        {
            factory = ( DecoderFactory ) clazz.newInstance();
        }
        catch ( IllegalAccessException iae )
        {
            throw new IOException( "Error accessing decoder for " + encodable );
        }
        catch ( InstantiationException ie )
        {
            throw new IOException( "Error instantiating decoder for " + encodable );
        }

        Decoder decoder = factory.getDecoder();

        return decoder.decode( plainText );
    }
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.