code: public void put(URI uri, byte[] bimg, BufferedImage img)
      {
          synchronized (bytemap)
          {
              while (bytesize > 1000 * 1000 * 50)
              {
                  URI olduri = bytemapAccessQueue.removeFirst();
                  byte[] oldbimg = bytemap.remove(olduri);
                  bytesize -= oldbimg.length;
                  log("removed 1 img from byte cache");
              }
  
              bytemap.put(uri, bimg);
              bytesize += bimg.length;
              bytemapAccessQueue.addLast(uri);
          }
          addToImageCache(uri, img);
      }
docs: Put a tile image into the cache. This puts both a buffered image and array of bytes that make up the compressed
  image.
  @param uri URI of image that is being stored in the cache
  @param bimg bytes of the compressed image, ie: the image file that was loaded over the network
  @param img image to store in the cache