Examples of BinaryValue


Examples of org.apache.jackrabbit.value.BinaryValue

        this.itemData.setMultiple(false);
    }

    @Override
    public void setValue(final Binary newValue) throws RepositoryException {
        this.itemData.setValues(new Value[] { new BinaryValue(newValue) });
        this.itemData.setMultiple(false);
    }
View Full Code Here

Examples of org.apache.jackrabbit.value.BinaryValue

    @Test
    public void testBinary() throws RepositoryException, IOException {
        byte[] value1 = new byte[] { 0x01, 0x01, 0x03 };

        this.node1.setProperty("prop1", new BinaryValue(value1).getBinary());
        Property prop1 = this.node1.getProperty("prop1");
        assertArrayEquals(value1, IOUtils.toByteArray(prop1.getBinary().getStream()));
        assertArrayEquals(value1, IOUtils.toByteArray(prop1.getValue().getBinary().getStream()));

        byte[] value2 = new byte[] { 0x04, 0x05, 0x06 };

        prop1.setValue(new BinaryValue(value2).getBinary());
        assertArrayEquals(value2, IOUtils.toByteArray(prop1.getBinary().getStream()));
        assertArrayEquals(value2, IOUtils.toByteArray(prop1.getValue().getBinary().getStream()));
    }
View Full Code Here

Examples of org.apache.jackrabbit.value.BinaryValue

     * @param stream the input stream
     * @return the value
     */
    @Converter
    public Value toValue(InputStream stream) {
        return new BinaryValue(stream);
    }
View Full Code Here

Examples of org.apache.jackrabbit.value.BinaryValue

     */
    public Value toJCRValue(NamespaceResolver nsResolver)
            throws RepositoryException {
        switch (type) {
            case PropertyType.BINARY:
                return new BinaryValue(((BLOBFileValue) val).getStream());
            case PropertyType.BOOLEAN:
                return new BooleanValue(((Boolean) val));
            case PropertyType.DATE:
                return new DateValue((Calendar) val);
            case PropertyType.DOUBLE:
View Full Code Here

Examples of org.apache.jackrabbit.value.BinaryValue

        return new BooleanValue(bool);
    }

    @Converter
    public static Value toValue(InputStream stream) {
        return new BinaryValue(stream);
    }
View Full Code Here

Examples of org.exist.xquery.value.BinaryValue

    {
        // is there some data to GZip?
        if(args[0].isEmpty())
            return Sequence.EMPTY_SEQUENCE;

        BinaryValue bin = (BinaryValue) args[0].itemAt(0);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        // gzip the data
        try
        {
            GZIPOutputStream gzos = new GZIPOutputStream(baos);
            bin.streamTo(gzos);
            gzos.close();

            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(baos.toByteArray()));
        }
        catch(IOException ioe)
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.value.BinaryValue

   }

   public void testGetBinaryAsStream() throws RepositoryException, IOException
   {

      node.setProperty("stream", new BinaryValue("inputStream"));
      Value value = node.getProperty("stream").getValue();
      InputStream iS = value.getStream();
      byte[] bytes = new byte[iS.available()];
      iS.read(bytes);
      assertEquals("inputStream", new String(bytes));
View Full Code Here

Examples of org.modeshape.jcr.value.BinaryValue

    @Override
    public InputStream getStream() throws ValueFormatException {
        if (value == null) return null;
        try {
            if (asStream == null) {
                BinaryValue binary = factories().getBinaryFactory().create(value);
                asStream = binary.getStream();
            }
            return asStream;
        } catch (Exception error) {
            throw createValueFormatException(InputStream.class);
        }
View Full Code Here

Examples of org.msgpack.value.BinaryValue

        }
        Value v = (Value) o;
        if (!v.isBinary()) {
            return false;
        }
        BinaryValue bv = v.asBinary();
        return bv.toByteBuffer().equals(byteBuffer);
    }
View Full Code Here

Examples of org.nasutekds.guitools.controlpanel.datamodel.BinaryValue

          editBinaryPanel.setValue(attrName, null);
        }
        editBinaryDlg.setVisible(true);
        if (editBinaryPanel.valueChanged())
        {
          BinaryValue changedValue = editBinaryPanel.getBinaryValue();
          binaryValue = changedValue;
          value = null;
          ocValue = null;
        }
        fireEditingStopped();
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.