code: @SuppressWarnings("unchecked")
      private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
          in.defaultReadObject();
          elements = (E[]) new Object[maxElements];
          final int size = in.readInt();
          for (int i = 0; i < size; i++) {
              elements[i] = (E) in.readObject();
          }
          start = 0;
          full = size == maxElements;
          if (full) {
              end = 0;
          } else {
              end = size;
          }
      }
docs: Read the queue in using a custom routine.
  
  @param in  the input stream
  @throws IOException if an I/O error occurs while writing to the output stream
  @throws ClassNotFoundException if the class of a serialized object can not be found