Examples of toByteArray()


Examples of com.bj58.spat.gaea.serializer.component.GaeaOutStream.toByteArray()

                    ((IGaeaSerializer) obj).Serialize(stream);
                } else {
                    SerializerFactory.GetSerializer(type).WriteObject(obj, stream);
                }
            }
            byte[] result = stream.toByteArray();
            return result;
        } finally {
            if (stream != null) {
                stream.close();
            }
View Full Code Here

Examples of com.caucho.vfs.TempOutputStream.toByteArray()

      tos.writeToStream(cOut);
      tos.destroy();

      cOut.close();

      byte []encryptedData = cipherOut.toByteArray();

      cipherOut.destroy();

      return encryptedData;
    } catch (RuntimeException e) {
View Full Code Here

Examples of com.cloudhopper.commons.util.FastByteArrayOutputStream.toByteArray()

        } catch (IOException e) {
            // should be an impossible error
            throw new RuntimeException("Impossible error with FastByteArrayOutputStream: " + e.getMessage(), e);
        }

        return baos.toByteArray();

    }

    @Override
    public int estimateDecodeCharLength(byte[] bytes) {
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpOutputStream.toByteArray()

    public void sublist_5() throws TermParserException, IOException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3,4]");
        final OtpErlangObject ss = r.getNthTail(2);
        final OtpOutputStream out = new OtpOutputStream();
        ss.encode(out);
        final byte[] contents1 = out.toByteArray();
        out.reset();
        final OtpErlangList s = (OtpErlangList) termParser.parse("[3,4]");
        s.encode(out);
        final byte[] contents2 = out.toByteArray();
        out.close();
View Full Code Here

Examples of com.example.tutorial.AddressBookProtos.Person.toByteArray()

    public void testPostPerson() throws Exception {
        MockHttpServletRequest request =
            MockRequestConstructor.constructMockRequest("POST", "/test/person", "application/x-protobuf");
        request.setContentType("application/x-protobuf");
        Person p = createPerson();
        request.setContent(p.toByteArray());
        MockHttpServletResponse response = invoke(request);
        assertEquals(200, response.getStatus());
        byte[] data = response.getContentAsByteArray();
        Person p1 = Person.parseFrom(data);
        assertEquals(p1);
View Full Code Here

Examples of com.facebook.presto.byteCode.SmartClassWriter.toByteArray()

        Map<String, byte[]> byteCodes = new LinkedHashMap<>();
        for (ClassDefinition classDefinition : classDefinitions) {
            ClassWriter cw = new SmartClassWriter(classInfoLoader);
            classDefinition.visit(cw);
            byte[] byteCode = cw.toByteArray();
            byteCodes.put(classDefinition.getType().getJavaClassName(), byteCode);
        }

        return classLoader.defineClasses(byteCodes);
    }
View Full Code Here

Examples of com.facebook.presto.hive.shaded.org.codehaus.jackson.util.ByteArrayBuilder.toByteArray()

    public byte[] writeValueAsBytes(Object value)
        throws IOException, JsonGenerationException, JsonMappingException
    {       
        ByteArrayBuilder bb = new ByteArrayBuilder(_jsonFactory._getBufferRecycler());
        _configAndWriteValue(_jsonFactory.createJsonGenerator(bb, JsonEncoding.UTF8), value);
        byte[] result = bb.toByteArray();
        bb.release();
        return result;
    }

    /*
 
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.core.util.ByteArrayBuilder.toByteArray()

        } catch (JsonProcessingException e) { // to support [JACKSON-758]
            throw e;
        } catch (IOException e) { // shouldn't really happen, but is declared as possibility so:
            throw JsonMappingException.fromUnexpectedIOE(e);
        }
        byte[] result = bb.toByteArray();
        bb.release();
        return result;
    }

    /*
 
View Full Code Here

Examples of com.fasterxml.jackson.core.util.ByteArrayBuilder.toByteArray()

        } catch (JsonProcessingException e) { // to support [JACKSON-758]
            throw e;
        } catch (IOException e) { // shouldn't really happen, but is declared as possibility so:
            throw JsonMappingException.fromUnexpectedIOE(e);
        }
        byte[] result = bb.toByteArray();
        bb.release();
        return result;
    }

    /*
 
View Full Code Here

Examples of com.fasterxml.storemate.shared.util.ByteAggregator.toByteArray()

        if (result.failed()) { // failed to contact any server
            _handleGetFailure(key, result);
        }
        // otherwise, we either got content, or got 404 or deletion
        ByteAggregator aggr = result.getContents();
        return (aggr == null) ? null : aggr.toByteArray();
    }

    /**
     * Convenience method for GETting specific content and storing it in specified file.
     * Note that failure to perform GET operation will be signaled with
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.