Package org.apache.avro.io

Examples of org.apache.avro.io.Decoder.readLong()


  public void testDecodeLong() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00, (byte) 0x01 });
    Decoder decoder = new ColumnDecoder(in);
    long i = decoder.readLong();
    assertEquals(1L, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0xff, (byte) 0xff,
        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
        (byte) 0xff });
View Full Code Here


    in = new ByteArrayInputStream(new byte[] { (byte) 0xff, (byte) 0xff,
        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
        (byte) 0xff });
    decoder = new ColumnDecoder(in);
    i = decoder.readLong();
    assertEquals(-1L, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0x00, (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00 });
View Full Code Here

    in = new ByteArrayInputStream(new byte[] { (byte) 0x00, (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00 });
    decoder = new ColumnDecoder(in);
    i = decoder.readLong();
    assertEquals(0L, i);
  }

  @Test
  public void testReadBytes() throws Exception {
View Full Code Here

  public void testDecodeLong() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x80,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00, (byte) 0x01 });
    Decoder decoder = new MemcmpDecoder(in);
    long i = decoder.readLong();
    assertEquals(1L, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0x7f, (byte) 0xff,
        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
        (byte) 0xff });
View Full Code Here

    in = new ByteArrayInputStream(new byte[] { (byte) 0x7f, (byte) 0xff,
        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
        (byte) 0xff });
    decoder = new MemcmpDecoder(in);
    i = decoder.readLong();
    assertEquals(-1L, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0x80, (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00 });
View Full Code Here

    in = new ByteArrayInputStream(new byte[] { (byte) 0x80, (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00 });
    decoder = new MemcmpDecoder(in);
    i = decoder.readLong();
    assertEquals(0L, i);
  }

  @Test
  public void testReadBytes() throws Exception {
View Full Code Here

  public void testDecodeLong() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x80,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00, (byte) 0x01 });
    Decoder decoder = new MemcmpDecoder(in);
    long i = decoder.readLong();
    assertEquals(1L, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0x7f, (byte) 0xff,
        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
        (byte) 0xff });
View Full Code Here

    in = new ByteArrayInputStream(new byte[] { (byte) 0x7f, (byte) 0xff,
        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
        (byte) 0xff });
    decoder = new MemcmpDecoder(in);
    i = decoder.readLong();
    assertEquals(-1L, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0x80, (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00 });
View Full Code Here

    in = new ByteArrayInputStream(new byte[] { (byte) 0x80, (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00 });
    decoder = new MemcmpDecoder(in);
    i = decoder.readLong();
    assertEquals(0L, i);
  }

  @Test
  public void testReadBytes() throws Exception {
View Full Code Here

  public void testDecodeLong() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
        (byte) 0x00, (byte) 0x01 });
    Decoder decoder = new ColumnDecoder(in);
    long i = decoder.readLong();
    assertEquals(1L, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0xff, (byte) 0xff,
        (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
        (byte) 0xff });
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.