// Path: lib-truetypeparser/src/main/java/com/jaredrummler/fontreader/io/IOUtils.java
// public static final int EOF = -1;


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.SequenceInputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static com.jaredrummler.fontreader.io.IOUtils.EOF;
   *     the byte to write
   */
  @Override
  public synchronized void write(final int b) {
    int inBufferPos = count - filledBufferSum;
    if (inBufferPos == currentBuffer.length) {
      needNewBuffer(count + 1);
      inBufferPos = 0;
    }
    currentBuffer[inBufferPos] = (byte) b;
    count++;
  }

  /**
   * Writes the entire contents of the specified input stream to this
   * byte stream. Bytes from the input stream are read directly into the
   * internal buffers of this streams.
   *
   * @param in
   *     the input stream to read from
   * @return total number of bytes read from the input stream
   * (and written to this stream)
   * @throws IOException
   *     if an I/O error occurs while reading the input stream
   * @since 1.4
   */
  public synchronized int write(final InputStream in) throws IOException {
    int readCount = 0;
    int inBufferPos = count - filledBufferSum;
    int n = in.read(currentBuffer, inBufferPos, currentBuffer.length - inBufferPos);
// Path: lib-truetypeparser/src/main/java/com/jaredrummler/fontreader/io/IOUtils.java
// public static final int EOF = -1;


// Path: lib-truetypeparser/src/main/java/com/jaredrummler/fontreader/io/ByteArrayOutputStream.java
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.SequenceInputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static com.jaredrummler.fontreader.io.IOUtils.EOF;

   *     the byte to write
   */
  @Override
  public synchronized void write(final int b) {
    int inBufferPos = count - filledBufferSum;
    if (inBufferPos == currentBuffer.length) {
      needNewBuffer(count + 1);
      inBufferPos = 0;
    }
    currentBuffer[inBufferPos] = (byte) b;
    count++;
  }

  /**
   * Writes the entire contents of the specified input stream to this
   * byte stream. Bytes from the input stream are read directly into the
   * internal buffers of this streams.
   *
   * @param in
   *     the input stream to read from
   * @return total number of bytes read from the input stream
   * (and written to this stream)
   * @throws IOException
   *     if an I/O error occurs while reading the input stream
   * @since 1.4
   */
  public synchronized int write(final InputStream in) throws IOException {
    int readCount = 0;
    int inBufferPos = count - filledBufferSum;
    int n = in.read(currentBuffer, inBufferPos, currentBuffer.length - inBufferPos);
    while (n != EOF) {