@Override
  public void write(byte[] b, int off, int len) throws IOException {
    flushBits(); // See the flushBits method description

    ramc.putData(b, off, len, streamPos);
    streamPos += len;
  }
  @Override
  public void write(int b) throws IOException {
    flushBits(); // See the flushBits method description

    ramc.putData(b, streamPos);
    streamPos++;
  }