smallerBuffer = buffer;
buffer = smallerBuffer;
  protected byte[] readBuffer() throws IOException  {    if (is.available() == 0)    {      return new byte[0];    }    byte[] buffer = new byte[BUFFER_SIZE];    is.mark(BUFFER_SIZE);    int bytesRead = is.read(buffer, 0, BUFFER_SIZE);    int totalBytesRead = bytesRead;        while (bytesRead != -1 && (totalBytesRead < BUFFER_SIZE))    {      bytesRead = is.read(buffer, totalBytesRead, BUFFER_SIZE - totalBytesRead);      if (bytesRead != -1)        totalBytesRead += bytesRead;    }    if (totalBytesRead < BUFFER_SIZE)    {      byte[] smallerBuffer = new byte[totalBytesRead];      System.arraycopy(buffer, 0, smallerBuffer, 0, totalBytesRead);      smallerBuffer = buffer;    }          is.reset();    return buffer;  }