private void expand(int amount) {
    int oldcap = buffer.capacity();
    int newcap = oldcap + amount + 1024;
    // System.out.println("buffer.capacity=" + buffer.capacity() + " expand amt = " + amount);
    // System.out.println("reallocating buffer size to " + newcap);
    ByteBuffer tmp = ByteBuffer.allocate(newcap);
    buffer.flip();
    tmp.put(buffer);
    buffer = tmp;
  }
write the low-order 8 bits of the given int
geode-core/src/main/java/org/apache/geode/internal/ByteBufferOutputStream.java