private byte[] readBtyeStream(InputStream oInputStream, int length)
            throws Exception {
        if (oInputStream != null) {
            int bufferSize = 1024;
            if (length > 0) {
                bufferSize = length;
            }
            ByteArrayOutputStream oBos = new ByteArrayOutputStream();
            int wMid = 0;
            byte[] bzBuf = new byte[bufferSize];
            while (true) {
                wMid = oInputStream.read(bzBuf, 0, bufferSize);
                if (wMid == -1)
                    break;
                oBos.write(bzBuf, 0, wMid);
            }
            oBos.flush();
            return oBos.toByteArray();
        }
        return null;
    }