Package com.sun.star.io

Examples of com.sun.star.io.XInputStream.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);
            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


        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

            }
            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

        m_aTestHelper.Error( "No input stream is available!" );
        return false;
      }

      xTempInStream1.readBytes( pDummyData, 3 );
      xTempInStream2.readBytes( pDummyData, 3 );


      // create temporary storage, it will be checked later
      Object oTargetStorage = m_xStorageFactory.createInstance();
      XStorage xTargetStorage = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTargetStorage );
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

              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.encode(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.";
            }
View Full Code Here

                            + (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;
            }
       
View Full Code Here

                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

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.