ldm/src/main/thredds/ldm/MessageBroker.java
public void process(InputStream is) throws IOException {
    int pos = -1;
    Buffer b = null;

    while (true) {
      b = (pos < 0) ? readBuffer(is) : readBuffer(is, b, pos);
      pos = process(b, is);
      if (b.done) break;
    }
  }
public void process(InputStream is) throws IOException {
    int pos = -1;
    Buffer b = null;

    while (true) {
      b = (pos < 0) ? readBuffer(is) : readBuffer(is, b, pos);
      pos = process(b, is);
      if (b.done) break;
    }
  }
Step 1 - read and extract a Bufr Message