@Override
    public int read() throws IOException {
      int data;
      try {
        data = myDelegate.read();
      }
      catch (IOException e) {
        myStreamCopy = null;
        throw e;
      }
      if (myStreamCopy != null) {
        if (data < 0) {
          cacheResult(myURL, myStreamCopy.toByteArray());
          myStreamCopy = null;
        }
        else if (myStreamCopy.size() + 1 > MAX_DATA_SIZE) {
          myStreamCopy = null;
        }
        else {
          myStreamCopy.write(data);
        }
      }
      return data;
    }
@Override
    public int read()