Package org.apache.avro.io

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


  @Test
  public void testDecodeInt() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x01});
    Decoder decoder = new ColumnDecoder(in);
    int i = decoder.readInt();
    assertEquals(1, i);

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


    assertEquals(1, i);

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

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

    assertEquals(-1, i);

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

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

  @Test
  public void testDecodeInt() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x80,
        (byte) 0x00, (byte) 0x00, (byte) 0x01 });
    Decoder decoder = new MemcmpDecoder(in);
    int i = decoder.readInt();
    assertEquals(1, i);

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

    assertEquals(1, i);

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

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

    assertEquals(-1, i);

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

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

  @Test
  public void testDecodeInt() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x80,
        (byte) 0x00, (byte) 0x00, (byte) 0x01 });
    Decoder decoder = new MemcmpDecoder(in);
    int i = decoder.readInt();
    assertEquals(1, i);

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

    assertEquals(1, i);

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

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

    assertEquals(-1, i);

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

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

  @Test
  public void testDecodeInt() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x01});
    Decoder decoder = new ColumnDecoder(in);
    int i = decoder.readInt();
    assertEquals(1, i);

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