Examples of UnsafeByteArrayOutputStream


Examples of org.apache.lucene.util.UnsafeByteArrayOutputStream

  }

  @Test
  public void testDefaultCtor() throws Exception {
    UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream();
    int numValues = 5;
    for (int i = 0; i < numValues; i++) {
      ubaos.write(i);
    }

    assertEquals("invalid buffer length", numValues, ubaos.length());
   
    byte[] bytes = ubaos.toByteArray();
    for (int i = 0; i < numValues; i++) {
      assertEquals(i, bytes[i]);
    }
  }
View Full Code Here

Examples of org.apache.lucene.util.UnsafeByteArrayOutputStream

    }
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void testIllegalBufferSize() throws Exception {
    UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream();
    ubaos.reInit(new byte[0]);
  }
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.