public static Long readLong(ByteBuffer buffer) { if (buffer != null) { return buffer.getLong(); } else { return 0L; } }