Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. byte[] buffer = new byte[4096];
  2. RegionFile region = RegionFileCache.getRegionFile(baseFolder, x, z);
  3. try {
  4. DataInputStream istream = new DataInputStream(new GZIPInputStream(new FileInputStream(chunkFile)));
  5.  
  6. DataOutputStream out = region.getChunkDataOutputStream(x & 31, z & 31);
  7.  
  8. int length = 0;
  9. while ((length = istream.read(buffer)) != -1) {
  10. out.write(buffer, 0, length);
  11. }
  12.  
  13. out.close();
  14. istream.close();
  15. } catch (IOException e) {
  16. e.printStackTrace();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement