public synchronized void write(int b) {
    if (nBytes < maxBytes) {
      ++nBytes;
      super.write(b);
    }
  }
Writes the specified byte to this byte array output stream.
Any bytes after the first maxBytes will be ignored.

@param   b   the byte to be written.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/MaxByteArrayOutputStream.java