Package com.impossibl.postgres.utils

Examples of com.impossibl.postgres.utils.NullByteBuf.readableBytes()


    // Compute length using null channel buffer
    NullByteBuf lengthComputer = new NullByteBuf();
    codec.encoder.encode(type, lengthComputer, val, conn);

    assertEquals(typeName + " computes length incorrectly", lengthComputer.readableBytes(), length);
  }

  private void assertStreamEquals(InputStream expected, InputStream actual) throws IOException {
    expected.reset();
    actual.reset();
View Full Code Here


  @Override
  public int length(Type type, Object val, Context context) throws IOException {
    NullByteBuf computer = new NullByteBuf();
    encode(type, computer, val, context);
    return computer.readableBytes();
  }

}
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.