Examples of ByteArrayOutputStream

@author Michael Zhou
  • com.alibaba.simpleimage.io.ByteArrayOutputStream
    本代码专为图片缓存使用,故默认缓冲区设得比较大 非同步的ByteArrayOutputStream替换方案, 执行toByteArray()方法时返回的是只读的内部字节数组, 避免了没有必要的字节复制. 本代码移植自IBM developer works精彩文章, 参见package文档. @author Michael Zhou @author wendell @version $Id: ByteArrayOutputStream.java 593 2004-02-26 13:47:19Z baobao $
  • com.ibm.jvm.util.ByteArrayOutputStream
  • com.zaranux.client.crypto.ByteArrayOutputStream
    This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it. The data can be retrieved using toByteArray() and toString().

    Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException. @author Arthur van Hoff @since JDK1.0

  • java.io.ByteArrayOutputStream
    ByteArrayOutputStream is a class whose underlying stream is represented by a byte array. As bytes are written to this stream, the local byte array may be expanded to hold more bytes. @see ByteArrayInputStream
  • net.gleamynode.netty.array.ByteArrayOutputStream
    @author The Netty Project (netty@googlegroups.com) @author Trustin Lee (trustin@gmail.com) @version $Rev: 476 $, $Date: 2008-07-04 15:06:37 +0900 (Fri, 04 Jul 2008) $ @see ByteArrayInputStream @see ByteArrayBufferInputStream @apiviz.uses net.gleamynode.netty.array.CompositeByteArray
  • org.apache.activeio.util.ByteArrayOutputStream
  • org.apache.activemq.util.ByteArrayOutputStream
    Very similar to the java.io.ByteArrayOutputStream but this version is not thread safe and the resulting data is returned in a ByteSequence to avoid an extra byte[] allocation.
  • org.apache.axis.utils.ByteArrayOutputStream
    This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it.

    The data can be retrieved using toByteArray() and toString().

    Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

    This is an alternative implementation of the java.io.ByteArrayOutputStream class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored. @author Jeremias Maerki

  • org.apache.commons.io.output.ByteArrayOutputStream
    This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it.

    The data can be retrieved using toByteArray() and toString().

    Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

    This is an alternative implementation of the java.io.ByteArrayOutputStream class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored. @author Jeremias Maerki @version $Id: ByteArrayOutputStream.java 369075 2006-01-14 18:23:42Z scolebourne $

  • org.apache.wicket.util.io.ByteArrayOutputStream
    This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it.

    The data can be retrieved using toByteArray() and toString().

    Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

    This is an alternative implementation of the java.io.ByteArrayOutputStream class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored. @author Jeremias Maerki @version $Id$

  • org.fusesource.hawtbuf.ByteArrayOutputStream
    irino.com">Hiram Chirino
  • org.more.util.io.output.ByteArrayOutputStream
    This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it.

    The data can be retrieved using toByteArray() and toString().

    Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

    This is an alternative implementation of the {@link java.io.ByteArrayOutputStream}class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored. @version $Id: ByteArrayOutputStream.java 1304052 2012-03-22 20:55:29Z ggregory $

  • webit.script.util.ByteArrayOutputStream

  • Examples of java.io.ByteArrayOutputStream

             * Read the input stream and dump it all into a big byte array
             */
            static byte[] slurpInputStream(InputStream stream) throws IOException {
                final int chunkSize=2048;
                byte[] buf=new byte[chunkSize];
                ByteArrayOutputStream byteStream=new ByteArrayOutputStream(chunkSize);
                int count;

                while((count=stream.read(buf)) != -1) byteStream.write(buf, 0, count);

                return byteStream.toByteArray();
            }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

            }
          return filePath;
      }
     
      public static final <T extends Serializable> T helpSerialize(T object) throws IOException, ClassNotFoundException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(baos);
            oos.writeObject(object);
            oos.flush();
           
            ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
           
            return (T)ois.readObject();
      }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

        public TestExternalizeUtil(String name) {
            super(name);
        }

        public void setUp() throws Exception {
            bout = new ByteArrayOutputStream(4096);
            oout = new ObjectOutputStream(bout);
        }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

            ArrayList test = new ArrayList(Arrays.asList(new String[] {ALPHA_L, ALPHA_U, CLEARTEXT, NUMBERS}));
           
            Object result = randomSymCryptor.sealObject(test);

            //ensure that we can serialize
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(baos);
            oos.writeObject(result);
           
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            ObjectInputStream ois = new ObjectInputStream(bais);
            result = ois.readObject();
           
            ArrayList clearObject = (ArrayList)randomSymCryptor.unsealObject(result);
           
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

     
        /**
       * @return an XmpMetadata byte array
       */
      private byte[] createXmpMetadataBytes() {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
          try {
            XmpWriter xmp = new XmpWriter(baos, pdf.getInfo(), pdfxConformance.getPDFXConformance());
              xmp.close();
          }
          catch(IOException ioe) {
              ioe.printStackTrace();
          }
          return baos.toByteArray();
      }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

        public static byte[] convertToByteArray(final InputStream is, int length) throws IOException {
          return convertToByteArray(is, length, true);
        }
       
        public static byte[] convertToByteArray(final InputStream is, int length, boolean close) throws IOException {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            write(out, is, length, close);
            out.close();
            return out.toByteArray();     
        }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

         * @param objectCustomizers
         * @return
         */
        public static final String writeMetadata(Object rootObject,
            Map<Class<? extends Object>, JSONObjectCustomizer> objectCustomizers,boolean isSchema){
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          WSJSONWriter  writter = new WSJSONWriter(out, rootObject, objectCustomizers);
          writter.writeMetadata(JSONCodec.dateFormat, JSONCodec.excludeProperties,
              JSONCodec.includeProperties, JSONCodec.globalMapKeyPattern,
              JSONCodec.globalMapValuePattern, isSchema);
          return out.toString();
      }
    View Full Code Here

    Examples of net.gleamynode.netty.array.ByteArrayOutputStream

            }
            this.capacityIncrement = capacityIncrement;
        }

        public void writeObject(Object obj) throws IOException {
            ByteArrayOutputStream bout = new ByteArrayOutputStream(capacityIncrement, false);
            ObjectOutputStream oout = new CompactObjectOutputStream(bout);
            oout.writeObject(obj);
            oout.flush();
            oout.close();
       
            ByteArray array = bout.array();
            writeInt(array.length());
            array.copyTo(this);
        }
    View Full Code Here

    Examples of org.apache.activeio.util.ByteArrayOutputStream

        public void store(String id, Object data) throws IOException {
            log.debug("Storing object with id: " + id);
            Connection connection = null;
            try {
                ByteArrayOutputStream buffer = new ByteArrayOutputStream();
                ObjectOutputStream out = new ObjectOutputStream(buffer);
                out.writeObject(data);
                out.close();
                connection = factory.getDataSource().getConnection();
                factory.getAdapter().doStoreData(connection, name + ":" + id, buffer.toByteArray());
            } catch (Exception e) {
                throw (IOException) new IOException("Error storing object").initCause(e);
            } finally {
                if (connection != null) {
                    try {
    View Full Code Here

    Examples of org.apache.activemq.util.ByteArrayOutputStream

        }

        private void initializeWriting() throws MessageNotWriteableException {
            checkReadOnlyBody();
            if (this.dataOut == null) {
                this.bytesOut = new ByteArrayOutputStream();
                OutputStream os = bytesOut;
                ActiveMQConnection connection = getConnection();
                if (connection != null && connection.isUseCompression()) {
                    compressed = true;
                    os = new DeflaterOutputStream(os);
    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.