cornedor

Untitled

Nov 4th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. private void a(jp paramjp) {
  2.     File localFile = d("server-icon.png");
  3.     if (localFile.isFile()) {
  4.       ByteBuf localByteBuf1 = Unpooled.buffer();
  5.       try
  6.       {
  7.         BufferedImage localBufferedImage = ImageIO.read(localFile);
  8.         Validate.validState(localBufferedImage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]);
  9.         Validate.validState(localBufferedImage.getHeight() == 64, "Must be 64 pixels high", new Object[0]);
  10.         ImageIO.write(localBufferedImage, "PNG", new ByteBufOutputStream(localByteBuf1));
  11.         ByteBuf localByteBuf2 = Base64.encode(localByteBuf1);
  12.         paramjp.a("data:image/png;base64," + localByteBuf2.toString(Charsets.UTF_8));
  13.       } catch (Exception localException) {
  14.         h.error("Couldn't load server icon", localException);
  15.       }
  16.     }
  17.   }
Advertisement
Add Comment
Please, Sign In to add comment