Examples of Decoder


Examples of net.sf.hajdbc.codec.Decoder

  @Test
  public void getConnectionProperties() throws SQLException
  {
    Database<Void> database = mock(Database.class);
    Decoder decoder = mock(Decoder.class);
    Connection connection = mock(Connection.class);
    DatabaseMetaData metaData = mock(DatabaseMetaData.class);
    String host = "myhost";
    String port = "1234";
    String databaseName = "mydb";
View Full Code Here

Examples of net.sf.hajdbc.codec.Decoder

  private final DecoderFactory factory = new MultiplexingDecoderFactory();
 
  @Test
  public void decodeSimple() throws SQLException
  {
    Decoder codec = this.factory.createDecoder(null);
   
    Assert.assertEquals("password", codec.decode("password"));
  }
View Full Code Here

Examples of net.sf.hajdbc.codec.Decoder

  }
 
  @Test
  public void decodeHex() throws SQLException
  {
    Decoder codec = this.factory.createDecoder(null);
   
    Assert.assertEquals("password", codec.decode("16:70617373776f7264"));
  }
View Full Code Here

Examples of net.sf.hajdbc.codec.Decoder

  }
 
  @Test
  public void decodeBase64() throws SQLException
  {
    Decoder codec = this.factory.createDecoder(null);
   
    Assert.assertEquals("password", codec.decode("64:cGFzc3dvcmQ="));
  }
View Full Code Here

Examples of net.sf.hajdbc.codec.Decoder

 
  @Override
  @Test
  public void test() throws SQLException
  {
    Decoder codec = this.factory.createDecoder(null);
   
    Assert.assertEquals("password", codec.decode("?:wzAkF0hlYUeGhfzRQIxYAQ=="));
  }
View Full Code Here

Examples of net.sf.hajdbc.codec.Decoder

   */
  @Override
  public <Z, D extends Database<Z>> void synchronize(SynchronizationContext<Z, D> context) throws SQLException
  {
    Dialect dialect = context.getDialect();
    Decoder decoder = context.getDecoder();
    DumpRestoreSupport support = dialect.getDumpRestoreSupport();
   
    if (support == null)
    {
      throw new SQLException(Messages.DUMP_RESTORE_UNSUPPORTED.getMessage(dialect));
View Full Code Here

Examples of net.sourceforge.jaad.aac.Decoder

            } else
                in = new BufferedInputStream(new FileInputStream(trackData.getFile()), BUFFER_SIZE);

            adts = new ADTSDemultiplexer(in);
            audioFormat = new AudioFormat(adts.getSampleFrequency(), 16, adts.getChannelCount(), true, true);
            decoder = new Decoder(adts.getDecoderSpecificInfo());
            buffer = new SampleBuffer();
            trackData.setChannels(adts.getChannelCount());
            trackData.setSampleRate(adts.getSampleFrequency());
            trackData.setBps(16);
            errorCount = 0;
View Full Code Here

Examples of net.tomp2p.message.Decoder

  /**
   * Decodes a message which was encoded using {{@link #encodeMessage(Message, SignatureFactory)}}.
   */
  public static Message decodeMessage(Buffer buf, InetSocketAddress recipient, InetSocketAddress sender, SignatureFactory signatureFactory)
          throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, SignatureException, IOException {
    Decoder d = new Decoder(signatureFactory);
    final int readerBefore = buf.buffer().readerIndex();
    d.decodeHeader(buf.buffer(), recipient, sender);
    final boolean donePayload = d.decodePayload(buf.buffer());
    d.decodeSignature(buf.buffer(), readerBefore, donePayload);
    return d.message();
  }
View Full Code Here

Examples of org.apache.avro.io.Decoder

    writer.write(datum, encoder);
    encoder.flush();
    byte[] data = out.toByteArray();

    reader.setSchema(schema);
    Decoder decoder = new JsonDecoder(schema, new ByteArrayInputStream(data));
    Object decoded = reader.read(null, decoder);
    assertEquals("Decoded data does not match.", datum, decoded);

    decoded = reader.read(decoded, decoder);
    assertEquals("Decoded data does not match.", datum, decoded);
View Full Code Here

Examples of org.apache.avro.io.Decoder

    DatumWriter<Object> writer = new GenericDatumWriter<Object>(actual);
    Encoder encoder = new BinaryEncoder(out);
    writer.write(new GenericData.EnumSymbol("Y"), encoder);
    writer.write(new GenericData.EnumSymbol("X"), encoder);
    byte[] data = out.toByteArray();
    Decoder decoder = DecoderFactory.defaultFactory().createBinaryDecoder(
        data, null);
    DatumReader<String> in = new GenericDatumReader<String>(actual, expected);
    assertEquals("Wrong value", new GenericData.EnumSymbol("Y"),
                 in.read(null, decoder));
    try {
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.