Package com.sun.star.io

Examples of com.sun.star.io.XInputStream.readBytes()


                xSeek.seek(0);
                xSeek = null;
                //read all bytes
                XInputStream xInput = m_RootStream.getInputStream();
                byte oledata[][] = new byte[1][oleLength];
                xInput.readBytes(oledata, oleLength);
                //return the base64 encoded string
                return Base64.encodeBytes(oledata[0]);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
View Full Code Here


            byte pLength[][] = new byte[1][4];
            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xSubStream);
            xSeek.seek(0);
            xSeek = null;
            //Get the uncompressed length
            int readbytes = xSubStream.readBytes(pLength, 4);
            if (4 != readbytes) {
                System.out.println("readbytes:" + readbytes);
                return "Can not read the length.";
            }
            int oleLength = (pLength[0][0] << 0) + (pLength[0][1] << 8) + (pLength[0][2] << 16) + (pLength[0][3] << 24);
View Full Code Here

                return "Can not read the length.";
            }
            int oleLength = (pLength[0][0] << 0) + (pLength[0][1] << 8) + (pLength[0][2] << 16) + (pLength[0][3] << 24);
            byte pContents[][] = new byte[1][oleLength];
            //Read all bytes. The compressed length should less then the uncompressed length
            readbytes = xSubStream.readBytes(pContents, oleLength);
            if (oleLength < readbytes) {
                return "oleLength :" + oleLength + " readbytes: " + readbytes;
            }

            // Decompress the bytes
View Full Code Here

            }
            LogUtils.DEBUG("size of file " + path  + " is " + sz );
            LogUtils.DEBUG("available = " + xInputStream.available() );
            inputBytes[0] = new byte[sz];

            ln = xInputStream.readBytes(inputBytes, sz);

            if (ln != sz) {
                throw new IOException(
                    "Failed to read " + sz + " bytes from XInputStream");
            }
View Full Code Here

      XInputStream rIn = (XInputStream)UnoRuntime.queryInterface(XInputStream.class, rOut);
      if(rIn.available() != 10)
        System.err.println("wrong bytes available\n");

      if(rIn.readBytes(bytes, 10) != 10)
        System.err.println("wrong bytes read\n");

      if(42 != bytes[0][0])
        System.err.println("wrong element in sequence\n");
    }
View Full Code Here

        XInputStream xInStream = checker.getInStream();
        byte[][] readData = new byte[1][data.length];
        int iReadBytes = 0;
        try {
            iReadBytes = xInStream.readBytes(readData, data.length);
        } catch(com.sun.star.io.IOException e) {
            log.println("Couldn't read data:" + e);
            res = false;
        }
View Full Code Here

      XInputStream rIn = UnoRuntime.queryInterface(XInputStream.class, rOut);
      if(rIn.available() != 10)
        System.err.println("wrong bytes available\n");

      if(rIn.readBytes(bytes, 10) != 10)
        System.err.println("wrong bytes read\n");

      if(42 != bytes[0][0])
        System.err.println("wrong element in sequence\n");
    }
View Full Code Here

        }

        XInputStream xInStream = checker.getInStream();
        byte[][] readData = new byte[1][data.length];
        try {
            xInStream.readBytes(readData, data.length);
        } catch(com.sun.star.io.IOException e) {
            log.println("Couldn't read data:" + e);
            res = false;
        }
View Full Code Here

        {
          XInputStream xInStream = xLinkStream.getInputStream();
          if ( xInStream != null )
          {
            byte[][] pBuff = new byte[1][0];
            int nRead = xInStream.readBytes( pBuff, 1000 );
            m_aLinkURI = new String( pBuff[0] );
            xInStream.closeInput();
            oEmbObj = xEmbedFactory.createInstanceLink( m_aLinkURI );
            m_bLinkObj = true;
          }
View Full Code Here

            String aResult = new String();

            int nLen = 0;
            do
            {
                nLen = xInStream.readBytes( aData, 10 );
                if ( aData.length == 0 || aData[0] == null )
                    throw new com.sun.star.io.IOException();
                aResult += new String( aData[0] );
            } while( nLen > 0 );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.