/** * Read some bytes from the stream. * @param b The byte array that will hold the contents from the stream. * @return The number of bytes returned or -1 if the end of stream has been * reached. * @see java.io.InputStream#read(byte[]) * @throws IOException if an IO problem occurs. */ public int read (byte[] b) throws IOException { return read(b, 0, b.length); }
/** * Read some bytes from the stream. * @param b The byte array that will hold the contents from the stream. * @return The number of bytes returned or -1 if the end of stream has been * reached. * @see java.io.InputStream#read(byte[]) * @throws IOException if an IO problem occurs. */ public int read (byte[] b) throws IOException { return read(b, 0, b.length); }
/** * Read some bytes from the stream. * @param b The byte array that will hold the contents from the stream. * @return The number of bytes returned or -1 if the end of stream has been * reached. * @see java.io.InputStream#read(byte[]) * @throws IOException if an IO problem occurs. */ public int read (byte[] b) throws IOException { return read(b, 0, b.length); }
/** * Read some bytes from the stream. * @param b The byte array that will hold the contents from the stream. * @return The number of bytes returned or -1 if the end of stream has been * reached. * @see java.io.InputStream#read(byte[]) * @throws IOException if an IO problem occurs. */ public int read (byte[] b) throws IOException { return read(b, 0, b.length); }
/** * Read some bytes from the stream. * @param b The byte array that will hold the contents from the stream. * @return The number of bytes returned or -1 if the end of stream has been * reached. * @see java.io.InputStream#read(byte[]) * @throws IOException if an IO problem occurs. */ public int read (byte[] b) throws IOException { return read(b, 0, b.length); }
public static byte[] unchunkdata(byte[] contentBytes) throws IOException { byte[] unchunkedData = null; byte[] buffer = new byte[1024]; ByteArrayInputStream bis = new ByteArrayInputStream(contentBytes); ChunkedInputStream cis = new ChunkedInputStream(bis); ByteArrayOutputStream bos = new ByteArrayOutputStream(); int read = -1; while ((read = cis.read(buffer)) != -1) { bos.write(buffer, 0, read); } unchunkedData = bos.toByteArray(); bos.close(); return unchunkedData; }