urbanairship-core/src/main/java/com/urbanairship/widget/UAWebViewClient.java
private String readNativeBridge() throws IOException {
            InputStream input = context.getResources().openRawResource(R.raw.ua_native_bridge);
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

            try {
                byte[] buffer = new byte[1024];
                int length;

                while ((length = input.read(buffer)) != -1) {
                    outputStream.write(buffer, 0, length);
                }

                return outputStream.toString();
            } finally {
                try {
                    input.close();
                    outputStream.close();
                } catch (Exception e) {
                    Logger.debug("Failed to close streams", e);
                }
            }
        }
/**
         * Helper method to read the native bridge from resources.
         *
         * @return The native bridge.
         * @throws IOException
         */
Helper method to read the native bridge from resources.
@return The native bridge.
Helper method to read the native bridge from resources . @return The native bridge .
private String readNativeBridge() throws IOException {
            InputStream input = context.getResources().openRawResource(R.raw.ua_native_bridge);
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            try {
                byte[] buffer = new byte[1024];
                int length;
                while ((length = input.read(buffer)) != -1) {
                    outputStream.write(buffer, 0, length);
                }
                return outputStream.toString();
            } finally {
                try {
                    input.close();
                    outputStream.close();
                } catch (Exception e) {
                    Logger.debug("Failed to close streams", e);
                }
            }
        }
private String readNativeBridge ( ) throws IOException { InputStream input = context . getResources ( ) . openRawResource ( R . raw . ua_native_bridge ) ; ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; try { byte [ ] buffer = new byte [ 1024 ] ; int length ; while ( ( length = input . read ( buffer ) ) != - 1 ) { outputStream . write ( buffer , 0 , length ) ; } return outputStream . toString ( ) ; } finally { try { input . close ( ) ; outputStream . close ( ) ; } catch ( Exception e ) { Logger . debug ( "Failed to close streams" , e ) ; } } }
Helper method to read the native bridge from resources.
Helper method to read the native bridge from resources .