From d04dcb7a6abd644c4c96dc8cc0e15d9e44656893 Mon Sep 17 00:00:00 2001 From: Maxime Joanis Date: Tue, 3 Jun 2014 16:41:32 -0400 Subject: [PATCH] JD2XXInputStream overrides InputStream.available() A call to jd2xx.getQueueStatus() is necessary to get the input buffer size. Otherwise, 0 is always obtained. --- jd2xx/jd2xx/JD2XXInputStream.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jd2xx/jd2xx/JD2XXInputStream.java b/jd2xx/jd2xx/JD2XXInputStream.java index 3181c52..e6c243c 100644 --- a/jd2xx/jd2xx/JD2XXInputStream.java +++ b/jd2xx/jd2xx/JD2XXInputStream.java @@ -66,4 +66,9 @@ public int read() throws IOException { public int read(byte[] b) throws IOException { return jd2xx.read(b); } + + public int available() throws IOException { + return jd2xx.getQueueStatus(); + } + }