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 by.stub.repackaged.org.apache.commons.io.output.ByteArrayOutputStream

        * {@link #copyLarge(InputStream, OutputStream)}
        */
       private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;

       public static byte[] toByteArray(InputStream input) throws IOException {
          ByteArrayOutputStream output = new ByteArrayOutputStream();
          copy(input, output);
          return output.toByteArray();
       }
    View Full Code Here

    Examples of com.alibaba.antx.util.ByteArrayOutputStream

            if (contentType != null && contentType.startsWith("text/html")) {
                try {
                    Tidy tidy = new Tidy();
                    tidy.setQuiet(true);
                    tidy.setXmlOut(true);
                    tidy.setErrout(new PrintWriter(new ByteArrayOutputStream()));

                    org.w3c.dom.Document dom = tidy.parseDOM(resource.getInputStream(), null);

                    return new DOMReader().read(dom);
                } catch (Exception e) {
    View Full Code Here

    Examples of com.alibaba.citrus.util.io.ByteArrayOutputStream

            assertProductItem(newcart, 0, "item1", 10);
            assertProductItem(newcart, 1, "item2", 100);
        }

        private Cart deepClone() throws Exception {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(baos);

            oos.writeObject(cart);
            oos.close();

            ObjectInputStream ois = new ObjectInputStream(baos.toInputStream());

            try {
                return (Cart) ois.readObject();
            } finally {
                ois.close();
    View Full Code Here

    Examples of com.alibaba.simpleimage.io.ByteArrayOutputStream

                rootDir = imgDir;
            }

            FileInputStream inputStream = new FileInputStream(new File(rootDir, filename));

            ByteArrayOutputStream temp = new ByteArrayOutputStream();
            IOUtils.copy(inputStream, temp);
            IOUtils.closeQuietly(inputStream);

            InputStream img = temp.toInputStream();
            temp = null;

            System.out.println("***********Performance Test**************");

            for (int i = 0; i < frequency; i++) {
    View Full Code Here

    Examples of com.ibm.jvm.util.ByteArrayOutputStream

            if (DigestMap.get() == null)
                DigestMap.set(new HashMap<String, ResponseCtx>());
        }

        private ResponseCtx sendHttpPost(RequestCtx requestCtx) {
            ByteArrayOutputStream bout = new ByteArrayOutputStream();
            requestCtx.encode(bout, new Indenter(0), true);
            byte[] byteArray = bout.toByteArray();
            byte[] msgDigest = getDigestBytes(byteArray);

            if (msgDigest != null) {
                ResponseCtx responseCtx = DigestMap.get().get(new String(msgDigest));
                if (responseCtx != null) {
    View Full Code Here

    Examples of com.zaranux.client.crypto.ByteArrayOutputStream

        this.outputCallback = outputCallback;
      }
     
      public char removeLast(){
        byte[] ba = baos.toByteArray();
        baos = new ByteArrayOutputStream(); // clear the buffer
        for (int i = 0; i < ba.length-1; i++) {
          put(ba[i]);
        }
        return (char) ba[ba.length-1];
      }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

        assertEquals("AXN", list.getChannelAt(2).getName());
        assertEquals("W\u00f6hnungss\u00fcche", list.getChannelAt(3).getName());
        assertEquals("K\u00fcchendi\u00dfteln", list.getChannelAt(4).getName());
        assertEquals("\u00c4lbert \u7360", list.getChannelAt(5).getName());

        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        list.writeToStream(stream);

        assertEquals("de;GMT+01:00;DMAX;DMAX;(c) by DMAX;http://www.dmaxtv.de/;http://sender.wannawork.de/logos/DMAX.png;257;\"DMAX\"\n" +
            "de;GMT+01:00;EUROSPORT;Eurosport;(c) by Eurosport;;;0;\"Eurosport\"\n" +
            "de;GMT+01:00;AXN;AXN;(c) by AXN;http://www.axntv.de;;273;\"AXN\"\n" +
            "de;GMT+01:00;DMAXPUNNY;DMAX PUNNY;(c) by DMAX;http://www.dmaxtv.de/;http://sender.wannawork.de/logos/DMAX.png;257;\"W&ouml;hnungss&uuml;che\"\n" +
            "de;GMT+01:00;EUROSPORTPUNNY;Eurosport PUNNY;(c) by Eurosport;;;0;\"K&uuml;chendi&szlig;teln\"\n" +
            "de;GMT+01:00;AXNPUNNY;AXN PUNNY;(c) by AXN;http://www.axntv.de;;273;\"&Auml;lbert &#29536;\"",
            toString(new GZIPInputStream(new ByteArrayInputStream(stream.toByteArray()))));
      }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

        }
       
        public static String readFile(String fileName) throws Exception {
            FileInputStream fis = new FileInputStream(UnitTestUtil.getTestDataFile(fileName));
           
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
           
            int c = 0;
            while ((c = fis.read()) != -1) {
                baos.write(c);
            }
           
            return baos.toString();
        }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

          super(in);
          this.encoding = encoding;
        }

          public String readString() throws IOException {
              ByteArrayOutputStream buff = new ByteArrayOutputStream();
              while (true) {
                  int x = read();
                  if (x <= 0) {
                      break;
                  }
                  buff.write(x);
              }
              return new String(buff.toByteArray(), this.encoding);
          }
    View Full Code Here

    Examples of java.io.ByteArrayOutputStream

          tf.setOutputProperty(OutputKeys.INDENT, "yes");//$NON-NLS-1$
          tf.setOutputProperty(OutputKeys.METHOD, "xml");//$NON-NLS-1$
          tf.setOutputProperty(OutputKeys.STANDALONE, "yes");//$NON-NLS-1$
          tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
         
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          StreamResult xmlOut = new StreamResult(new BufferedOutputStream(out));
          tf.transform(xml.getSource(StreamSource.class), xmlOut);
         
          return out.toString();
        } catch (Exception e) {
          return xml.getString();
        }
      }  
    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.