From 0c2ba89c5532af85397248ce6a98cff396323b35 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 5 Aug 2012 14:21:34 +0800 Subject: [PATCH] Experimental change to use less memory for sockets - may break player NPCs --- src/main/java/net/citizensnpcs/npc/network/EmptySocket.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/network/EmptySocket.java b/src/main/java/net/citizensnpcs/npc/network/EmptySocket.java index e68200db0..baa2b1d60 100644 --- a/src/main/java/net/citizensnpcs/npc/network/EmptySocket.java +++ b/src/main/java/net/citizensnpcs/npc/network/EmptySocket.java @@ -10,11 +10,13 @@ public class EmptySocket extends Socket { @Override public InputStream getInputStream() { - return new ByteArrayInputStream(new byte[10]); + return new ByteArrayInputStream(EMPTY); } @Override public OutputStream getOutputStream() { - return new ByteArrayOutputStream(); + return new ByteArrayOutputStream(1); } + + private static final byte[] EMPTY = new byte[0]; } \ No newline at end of file