Would it make sense to use the SESSION_ID_HEADER_SIZE and LENGTH_HEADER_SIZE in here?