<commit_before>(ns clojurecraft.in
  (:use [clojurecraft.util])
  (:use [clojurecraft.mappings])
  (:use [clojurecraft.chunks])
  (:import (java.io DataInputStream))
  (:require [clojurecraft.data])
  (:require [clojurecraft.events :as events])
  (:import [clojurecraft.data Location Entity Chunk])
  (:import (java.util.zip Inflater)))

(def FULL-CHUNK (* 16 16 128))
(def BLANK-CHUNK-ARRAY (byte-array FULL-CHUNK))

; Convenience Functions ------------------------------------------------------------
(defn- blank-entity []
  (Entity. nil
           (Location. nil nil nil nil nil nil nil)
           nil nil false 0.0))


; Reading Data ---------------------------------------------------------------------
(defn- -read-byte-bare [conn]
  (io!
    (let [b (.readByte ^DataInputStream (:in @conn))]
      b)))

(defn- -read-byte [conn]
  (int (-read-byte-bare conn)))

(defn- -read-bytearray-bare [conn size]
  (io!
    (let [ba (byte-array size)]
         (.read ^DataInputStream (:in @conn) ba 0 size)
         ba)))

(defn- -read-bytearray [conn size]
  (vec (-read-bytearray-bare conn size)))

(defn- -read-int [conn]
  (io!
    (let [i (.readInt ^DataInputStream (:in @conn))]
      (Integer. i))))

(defn- -read-long [conn]
  (io!
    (let [l (.readLong ^DataInputStream (:in @conn))]
      (Long. l))))

(defn- -read-short [conn]
  (io!
    (let [s (.readShort ^DataInputStream (:in @conn))]<commit_msg>Dear Java: you are an asshole.<commit_after>(ns clojurecraft.in
  (:use [clojurecraft.util])
  (:use [clojurecraft.mappings])
  (:use [clojurecraft.chunks])
  (:import (java.io DataInputStream))
  (:require [clojurecraft.data])
  (:require [clojurecraft.events :as events])
  (:import [clojurecraft.data Location Entity Chunk])
  (:import (java.util.zip Inflater)))

(def FULL-CHUNK (* 16 16 128))
(def BLANK-CHUNK-ARRAY (byte-array FULL-CHUNK))

; Convenience Functions ------------------------------------------------------------
(defn- blank-entity []
  (Entity. nil
           (Location. nil nil nil nil nil nil nil)
           nil nil false 0.0))


; Reading Data ---------------------------------------------------------------------
(defn- -read-byte-bare [conn]
  (io!
    (let [b (.readByte ^DataInputStream (:in @conn))]
      b)))

(defn- -read-byte [conn]
  (int (-read-byte-bare conn)))

(defn- -read-bytearray-bare [conn size]
  (io!
    (let [ba (byte-array size)]
         (.readFully ^DataInputStream (:in @conn) ba 0 size)
         ba)))

(defn- -read-bytearray [conn size]
  (vec (-read-bytearray-bare conn size)))

(defn- -read-int [conn]
  (io!
    (let [i (.readInt ^DataInputStream (:in @conn))]
      (Integer. i))))

(defn- -read-long [conn]
  (io!
    (let [l (.readLong ^DataInputStream (:in @conn))]
      (Long. l))))

(defn- -read-short [conn]
  (io!
    (let [s (.readShort ^DataInputStream (:in @conn))]
{'fraction_non_alphanumeric': 0.25368938861560086, 'fraction_numerical': 0.007027406886858749, 'mean_word_length': 2.202474690663667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6165708', 'n_tokens_mistral': 1031, 'n_tokens_neox': 965, 'n_words': 264}