Examples of binaryDecoder()


Examples of org.apache.avro.io.DecoderFactory.binaryDecoder()

      fos.close();
    }
    {
      FileInputStream fis = new FileInputStream(file);
      DecoderFactory factory = new DecoderFactory();
      BinaryDecoder bd = factory.binaryDecoder(fis, null);
      SpecificDatumReader<User> sdr = new SpecificDatumReader<User>(User.class);
      User loaded = sdr.read(null, bd);
      fis.close();
      assertEquals(saved, loaded);
      assertEquals("Sam", loaded.firstName.toString());
View Full Code Here

Examples of org.apache.avro.io.DecoderFactory.binaryDecoder()

      fos.close();
    }
    {
      FileInputStream fis = new FileInputStream(file);
      DecoderFactory factory = new DecoderFactory();
      BinaryDecoder bd = factory.binaryDecoder(fis, null);
      SpecificDatumReader<User> sdr = new SpecificDatumReader<User>(User.class);
      User loaded = sdr.read(null, bd);
      fis.close();
      assertEquals(saved, loaded);
      assertEquals(null, loaded.location);
View Full Code Here

Examples of org.apache.avro.io.DecoderFactory.binaryDecoder()

          case JSON:
            d = decoderFactory.jsonDecoder(schema, is);
            break;
          case BINARY:
          default:
            d = decoderFactory.binaryDecoder(is, null);
            break;
        }
        // Read the data
        SpecificDatumReader<T> sdr = new SpecificDatumReader<T>(schema);
        sdr.setExpected(actualSchema);
View Full Code Here

Examples of org.apache.avro.io.DecoderFactory.binaryDecoder()

              if (len > valuebytes.length) {
                valuebytes = new byte[len];
              }
              dis.readFully(valuebytes, 0, len);
              DecoderFactory decoderFactory = new DecoderFactory();
              Decoder d = decoderFactory.binaryDecoder(new ByteArrayInputStream(valuebytes, 0, len), null);
              // Read the data
              SpecificDatumReader<Beacon> sdr = new SpecificDatumReader<Beacon>(writerSchema, Beacon.SCHEMA$);
              Beacon read = sdr.read(null, d);
              beaconFAB.put(row, read);
            }
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.