@Override public int available() throws IOException { final int otherAvailable = super.available(); // Hack. Docs say available() should return an estimate, // so we estimate about 1KB to work around available == 0 bug in GZIPInputStream return otherAvailable == 0 ? 1 << 10 : otherAvailable; } }
@Override public int available() throws IOException { if (done) { return 0; } return super.available(); }
@Override public int available() throws IOException { if (done) { return 0; } return super.available(); } }
@Override public int available() throws IOException { return Math.min(super.available(), limit); }
@Override public int available() throws IOException { return Math.min(super.available(), limit); }
public int available() { try { return super.available(); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public int available() throws IOException { return Math.min(super.available(), limit); }
/** * Invokes the delegate's <code>available()</code> method. * @return the number of available bytes * @throws IOException if an I/O error occurs */ @Override public int available() throws IOException { try { return super.available(); } catch (final IOException e) { handleIOException(e); return 0; } }
/** * Invokes the delegate's <code>available()</code> method. * * @return the number of available bytes * @throws IOException if an I/O error occurs */ @Override public int available() throws IOException { try { return super.available(); } catch (final IOException e) { handleIOException(e); return 0; } }
music=new byte[(int) file.length()];//size & length of the file InputStream is = new FileInputStream (file); BufferedInputStream bis = new BufferedInputStream (is, 8000); DataInputStream dis = new DataInputStream (bis); // Create a DataInputStream to read the audio data from the saved file int i = 0; // Read the file into the "music" array while (dis.available() > 0) { music[i] = dis.readByte(); // This assignment does not reverse the order i++; } dis.close(); // Close the input stream
InputStream is = new FileInputStream (file); BufferedInputStream bis = new BufferedInputStream (is, 8000); DataInputStream dis = new DataInputStream (bis); // Create a DataInputStream to read the audio data from the saved file int i = 0; // Read the file into the "music" array while (dis.available() > 0) { music[i] = dis.readShort(); // This assignment does not reverse the order i++; } dis.close(); // Close the input stream
@Override public int available() throws IOException { try { return super.available(); } catch (final IOException ioe) { throw new FlowFileAccessException("Could not determine amount of data available from " + flowFile, ioe); } }
response.setContentType("application/force-download"); response.setContentLength((int)f.length()); //response.setContentLength(-1); response.setHeader("Content-Transfer-Encoding", "binary"); response.setHeader("Content-Disposition","attachment; filename=\"" + "xxx\"");//fileName); ... ... File f= new File(fileName); InputStream in = new FileInputStream(f); BufferedInputStream bin = new BufferedInputStream(in); DataInputStream din = new DataInputStream(bin); while(din.available() > 0){ out.print(din.readLine()); out.print("\n"); }
/** * Obtains the number of bytes that can be read without blocking. * * @return the number of bytes available without blocking * @throws IOException in case of a problem */ public int available() throws IOException { int a = 0; // not -1 if (isReadAllowed()) { a = super.available(); // no checkClose() here, available() can't trigger EOF } return a; }
@Override @SuppressForbidden("just delegating") public int available() { try { return super.available(); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public int available() throws IOException { return Math.min(super.available(), remainingInt()); }
@Override public int available() throws IOException { return Math.min(super.available(), remainingInt()); }
@Override public int available() throws IOException { return (int) Math.min(super.available(), bytesLeft); }
public @Override int available() throws IOException { openStream(); return super.available(); }