edu.udayton.udri.asset.axis/src/edu/udayton/udri/asset/axis/AxisAsset.java
private byte[] writeImage() throws AssetException
    {
        final String urlString = m_CommandProcessor.processStillImageRequest(m_IpAddress);

        URLConnection connection = null;
        try 
        {
            connection = m_UrlService.constructUrlConnection(urlString);
        }
        catch (final IOException e)
        {
            throw new AssetException(e);
        }
        
        try (InputStream inStream = connection.getInputStream())
        {
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            final int size = 1024;
            final byte[] buffer = new byte[size];
            
            for (int readNum; (readNum = inStream.read(buffer)) != -1;) //NOCHECKSTYLE avoid inner assignments
            {
                baos.write(buffer, 0, readNum);
            }
            
            final byte[] imageData = baos.toByteArray();
            
            baos.flush();
            baos.close();
            return imageData;
        }
        catch (final IOException e)
        {
            throw new AssetException(e);
        }
    }
/**
     * Write a still image.
     * @return
     *      byte array containing the image data
     * @throws AssetException
     *      if the image data is invalid or unable to be acquired 
     */
Write a still image.
@return
byte array containing the image data
@throws AssetException
if the image data is invalid or unable to be acquired
Write a still image . @return byte array containing the image data @throws AssetException if the image data is invalid or unable to be acquired
private byte[] writeImage() throws AssetException
    {
        final String urlString = m_CommandProcessor.processStillImageRequest(m_IpAddress);
        URLConnection connection = null;
        try 
        {
            connection = m_UrlService.constructUrlConnection(urlString);
        }
        catch (final IOException e)
        {
            throw new AssetException(e);
        }
        try (InputStream inStream = connection.getInputStream())
        {
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            final int size = 1024;
            final byte[] buffer = new byte[size];
            for (int readNum; (readNum = inStream.read(buffer)) != -1;) 
            {
                baos.write(buffer, 0, readNum);
            }
            final byte[] imageData = baos.toByteArray();
            baos.flush();
            baos.close();
            return imageData;
        }
        catch (final IOException e)
        {
            throw new AssetException(e);
        }
    }
private byte [ ] writeImage ( ) throws AssetException { final String urlString = m_CommandProcessor . processStillImageRequest ( m_IpAddress ) ; URLConnection connection = null ; try { connection = m_UrlService . constructUrlConnection ( urlString ) ; } catch ( final IOException e ) { throw new AssetException ( e ) ; } try ( InputStream inStream = connection . getInputStream ( ) ) { final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; final int size = 1024 ; final byte [ ] buffer = new byte [ size ] ; for ( int readNum ; ( readNum = inStream . read ( buffer ) ) != - 1 ; ) { baos . write ( buffer , 0 , readNum ) ; } final byte [ ] imageData = baos . toByteArray ( ) ; baos . flush ( ) ; baos . close ( ) ; return imageData ; } catch ( final IOException e ) { throw new AssetException ( e ) ; } }
Write a still image.
Write a still image .
//NOCHECKSTYLE avoid inner assignments