cfa14b4

Bowmap · bowmap.git · Tickets

Branches > main > cfa14b4 > files

Throw generic IOException on EOF

Grahp, 2026-09-29

Commit: cfa14b45201002e2912545ee2a2898b80cbf07b3
Parent: 071c90b

1 changed file:

src/net/bowmap/server/network/streams.clj modified (view file)

@@ -4,11 +4,7 @@    [net.bowmap.server.protocol.frame :as frame]    [net.bowmap.server.protocol.types :refer [max-varint-size]])   (:import-   [java.io-    EOFException-    IOException-    InputStream-    OutputStream]))+   [java.io IOException InputStream OutputStream]))  (defn read-byte!!   "Blocks and reads an unsigned byte (int) from an InputStream.@@ -16,7 +12,7 @@   [input-stream]   (let [x (InputStream/.read input-stream)]     (if (= x -1)-      (throw (EOFException. "EOF while reading from InputStream"))+      (throw (IOException. "EOF while reading from InputStream"))       x)))  (defn read-varint!!@@ -43,7 +39,7 @@       (when (< offset len)         (let [r (InputStream/.read input-stream arr offset (- len offset))]           (if (= r -1)-            (throw (EOFException. "EOF while reading frame"))+            (throw (IOException. "EOF while reading frame"))             (recur (+ offset r))))))     (frame/frame arr)))