Java buffer server and client