Java Code Examples for io.netty.buffer.ByteBuf#getCharSequence()

The following examples show how to use io.netty.buffer.ByteBuf#getCharSequence() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static Float textDecodeFLOAT4(int index, int len, ByteBuf buff) {
  // Todo optimize that
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return Float.parseFloat(cs.toString());
}
 
Example 2
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static double textDecodeFLOAT8(int index, int len, ByteBuf buff) {
  // Todo optimize that
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return Double.parseDouble(cs.toString());
}
 
Example 3
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static Number textDecodeNUMERIC(int index, int len, ByteBuf buff) {
  // Todo optimize that
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return Numeric.parse(cs.toString());
}
 
Example 4
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static LocalDate textDecodeDATE(int index, int len, ByteBuf buff) {
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return LocalDate.parse(cs);
}
 
Example 5
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static LocalTime textDecodeTIME(int index, int len, ByteBuf buff) {
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return LocalTime.parse(cs);
}
 
Example 6
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static OffsetTime textDecodeTIMETZ(int index, int len, ByteBuf buff) {
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return OffsetTime.parse(cs, TIMETZ_FORMAT);
}
 
Example 7
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static LocalDateTime textDecodeTIMESTAMP(int index, int len, ByteBuf buff) {
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return LocalDateTime.parse(cs, TIMESTAMP_FORMAT);
}
 
Example 8
Source File: DataTypeCodec.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
private static OffsetDateTime textDecodeTIMESTAMPTZ(int index, int len, ByteBuf buff) {
  CharSequence cs = buff.getCharSequence(index, len, StandardCharsets.UTF_8);
  return OffsetDateTime.parse(cs, TIMESTAMPTZ_FORMAT);
}