private static DateTime ParseDateSlow(char[] buf, BufferedTextReader reader) { int foundAt = 4; for (; foundAt < buf.Length; foundAt++) { if (buf[foundAt] == '-') { break; } } if (foundAt == buf.Length) { throw new NotSupportedException("Invalid date value."); } var year = IntConverter.ParsePositive(buf, 0, foundAt); var newBuf = reader.CharBuffer; for (int i = foundAt + 1; i < buf.Length; i++) { newBuf[i - foundAt - 1] = buf[i]; } for (int i = buf.Length - foundAt - 1; i < 5; i++) { newBuf[i] = (char)reader.Read(); } return(new DateTime(year, NumberConverter.Read2(newBuf, 0), NumberConverter.Read2(newBuf, 3))); }
private static short ParseShort(BufferedTextReader reader, ref int cur, char endChar) { return((short)IntConverter.ParseInt(reader, ref cur, endChar)); }
public static IPostgresTuple ToTuple(short value) { return(IntConverter.ToTuple(value)); }
public static int Serialize(short value, char[] buf, int start) { return(IntConverter.Serialize(value, buf, start)); }