Package etch.util

Examples of etch.util.FlexBuffer


  /** @throws Exception */
  @Test( expected = IOException.class )
  public void bad4() throws Exception
  {
    // Create data to send
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet header:
      -34, -83, -66, -17, -1, -1, -1, -1 // negative packet size
        // packet data:
    } );
View Full Code Here


  /** @throws Exception */
  @Test
  public void singleSingleData0() throws Exception
  {
    // Create data to send
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet header:
      -34, -83, -66, -17, 0, 0, 0, 0
        // packet data:
    } );
View Full Code Here

  /** @throws Exception */
  @Test
  public void singleSingleData1() throws Exception
  {
    // length = 1
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet header:
      -34, -83, -66, -17, 0, 0, 0, 1,
        // packet data:
        1
View Full Code Here

  /** @throws Exception */
  @Test
  public void singleSingleData2() throws Exception
  {
    // length = 2
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet header:
      -34, -83, -66, -17, 0, 0, 0, 2,
        // packet data:
        3, 4
View Full Code Here

  /** @throws Exception */
  @Test
  public void data1() throws Exception
  {
    // 2x length = 0
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet header:
      -34, -83, -66, -17, 0, 0, 0, 0,
      // packet header:
      -34, -83, -66, -17, 0, 0, 0, 0
View Full Code Here

  /** @throws Exception */
  @Test
  public void data2() throws Exception
  {
    // length = 1, length = 0
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet 1 header:
      -34, -83, -66, -17, 0, 0, 0, 1,
        // packet 1 data:
        1,
View Full Code Here

  /** @throws Exception */
  @Test
  public void data3() throws Exception
  {
    // length = 0, length = 1
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet 1 header:
      -34, -83, -66, -17, 0, 0, 0, 0,
        // packet 1 data:
      // packet 2 header:
View Full Code Here

  /** @throws Exception */
  @Test
  public void data4() throws Exception
  {
    // 2x length = 1
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet 1 header:
      -34, -83, -66, -17, 0, 0, 0, 1,
        // packet 1 data:
        1,
View Full Code Here

  /** @throws Exception */
  @Test
  public void doubleSingleData2() throws Exception
  {
    // length = 2
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet 1 header:
      -34, -83, -66, -17, 0, 0, 0, 2,
        // packet 1 data:
        3, 4,
View Full Code Here

  /** @throws Exception */
  @Test
  public void doubleSingle_HeaderSplit_Data0() throws Exception
  {
    // length = 0
    FlexBuffer buf = new FlexBuffer( new byte[]
    {
      // packet 1 header (partial):
      -34, -83, -66, -17, 0, 0
    } );

    p.sessionData( who, buf );

    assertNull( session.what );
    assertTrue( session.check( null ) );
    assertNull( session.sender );

    FlexBuffer buf2 = new FlexBuffer( new byte[]
    {
      // packet 1 header (remainder):
        0, 0,
      // packet 2 header
        -34, -83, -66, -17, 0, 0, 0, 0
View Full Code Here

TOP

Related Classes of etch.util.FlexBuffer

Copyright © 2018 www.massapicom. 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.