Examples of ByteArrayInputStream

@author Michael Zhou
  • com.alibaba.common.lang.io.ByteArrayInputStream
    非同步的ByteArrayInputStream替换方案, 本代码移植自IBM developer works精彩文章, 参见package文档. @author Michael Zhou @version $Id: ByteArrayInputStream.java 509 2004-02-16 05:42:07Z baobao $
  • com.zaranux.client.crypto.ByteArrayInputStream
    A ByteArrayInputStream contains an internal buffer that contains bytes that may be read from the stream. An internal counter keeps track of the next byte to be supplied by the read method.

    Closing a ByteArrayInputStream 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 @see java.io.StringBufferInputStream @since JDK1.0

  • java.io.ByteArrayInputStream
    ByteArrayInputStream is used for streaming over a byte array. @see ByteArrayOutputStream
  • net.gleamynode.netty.array.ByteArrayInputStream
    @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 ByteArrayOutputStream @see ByteArrayBufferInputStream @apiviz.uses net.gleamynode.netty.array.ByteArray
  • org.apache.activeio.util.ByteArrayInputStream
  • org.apache.activemq.util.ByteArrayInputStream
    Very similar to the java.io.ByteArrayInputStream but this version is not thread safe.
  • org.apache.kahadb.util.ByteArrayInputStream
    Very similar to the java.io.ByteArrayInputStream but this version is not thread safe.
  • org.fusesource.hawtbuf.ByteArrayInputStream
    irino.com">Hiram Chirino

  • Examples of java.io.ByteArrayInputStream

                          "data length too big: " + dataLen + " (max: " + maxObjectSize + ')'); //$NON-NLS-1$ //$NON-NLS-2$
              }
              }
              fillBuffer();
              foundLength = false;
              ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
              buffer = null;
              CompactObjectInputStream cois = new CompactObjectInputStream(bais, classLoader);
              result = cois.readObject();
              streams = ExternalizeUtil.readList(cois, StreamFactoryReference.class);
              streamIndex = 0;
    View Full Code Here

    Examples of java.io.ByteArrayInputStream

      public Timestamp getTimestamp(int columnIndex) throws SQLException {
        throw new SQLException("Android does not support timestamp.  Use JAVA_DATE_LONG or JAVA_DATE_STRING types");
      }

      public InputStream getBlobStream(int columnIndex) throws SQLException {
        return new ByteArrayInputStream(cursor.getBlob(columnIndex));
      }
    View Full Code Here

    Examples of java.io.ByteArrayInputStream

      /* (non-Javadoc)
       * @see org.objectweb.joram.shared.stream.Streamable#readFrom(java.io.InputStream)
       */
      public void readFrom(InputStream is) throws IOException {
        principal = StreamUtil.readStringFrom(is);
        ByteArrayInputStream bais = null;
        ObjectInputStream ois = null;
        try {
          byte[] subByte = StreamUtil.readByteArrayFrom(is);
          bais = new ByteArrayInputStream(subByte);
          ois = new ObjectInputStream(bais);
          try {
            subject = (Subject) ois.readObject();
          } catch (ClassNotFoundException e) {
            if (logger.isLoggable(BasicLevel.ERROR))
              logger.log(BasicLevel.ERROR, "EXCEPTION:: readFrom", e);
            throw new IOException(e.getMessage());
          }
        } finally {
          try {
            ois.close();
          } catch (IOException exc) {}
          try {
            bais.close();
          } catch (IOException exc) {}
        }
      }
    View Full Code Here

    Examples of java.io.ByteArrayInputStream

        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.ByteArrayInputStream

        }
       
        public void testEmptyCollection() throws Exception {
          ExternalizeUtil.writeCollection(oout, Arrays.asList(new Object[0]));
          oout.flush();       
            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
            ObjectInputStream oin = new ObjectInputStream(bin);
           
            List<?> result = ExternalizeUtil.readList(oin);
            assertEquals(0, result.size());
        }
    View Full Code Here

    Examples of java.io.ByteArrayInputStream

            //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.ByteArrayInputStream

         */
        public SQLXMLImpl(final byte[] bytes) {
          super(new InputStreamFactory() {
          @Override
          public InputStream getInputStream() throws IOException {
            return new ByteArrayInputStream(bytes);
          }
        });
          setEncoding(Streamable.ENCODING);
      }
    View Full Code Here

    Examples of java.io.ByteArrayInputStream

              }
            }
        }

        public static InputStream convertToInputStream(byte[] data) {
            ByteArrayInputStream bais = new ByteArrayInputStream(data);
            InputStream isContent = new BufferedInputStream(bais);
            return isContent;
        }
    View Full Code Here

    Examples of java.io.ByteArrayInputStream

        /**
         * Returns the given bytes as a char array using a given encoding (null means platform default).
         */
        public static char[] bytesToChar(byte[] bytes, String encoding) throws IOException {

            return convertToCharArray(new ByteArrayInputStream(bytes), bytes.length, encoding);

        }
    View Full Code Here

    Examples of java.io.ByteArrayInputStream

          setConsumerName(regInfo.getConsumerName());
          setRegistrationHandle(regInfo.getRegistrationHandle());
          byte[] bytes = regInfo.getRegistrationState();
          if (bytes != null && bytes.length > 0)
          {
             ByteArrayInputStream is = new ByteArrayInputStream(bytes);
             setRegistrationState(is);
          }

          // clear and recreate registration properties
          List<RegistrationPropertyMapping> rpms = getRegistrationProperties();
    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.