diff --git a/escposprinter/src/main/java/com/dantsu/escposprinter/connection/DeviceConnection.java b/escposprinter/src/main/java/com/dantsu/escposprinter/connection/DeviceConnection.java index 030b007..42a178d 100644 --- a/escposprinter/src/main/java/com/dantsu/escposprinter/connection/DeviceConnection.java +++ b/escposprinter/src/main/java/com/dantsu/escposprinter/connection/DeviceConnection.java @@ -53,9 +53,9 @@ public void send(int addWaitingTime) throws EscPosConnectionException { try { this.stream.write(this.data); this.stream.flush(); - this.data = new byte[0]; - int waitingTime = addWaitingTime + (int) Math.floor(this.data.length / 16f); + int waitingTime = addWaitingTime + this.data.length / 16; + this.data = new byte[0]; if(waitingTime > 0) { Thread.sleep(waitingTime); }