Add method to retrieve the buffer as a byte array