Package java.io

Examples of java.io.ByteArrayInputStream


        fileVO.setPhysical(CvFileVO.FP_PHYSICAL);
        fileVO.setPhysicalFolder(attachmentFolderID);
        fileVO.setAuthorId(individualID);
        fileVO.setIsTemporary(CvFileVO.FIT_YES);

        ByteArrayInputStream inputStream = new ByteArrayInputStream(originalBody.getBytes());

        try {
          CvFileFacade fileFacade = new CvFileFacade();
          newFileID = fileFacade.addFile(individualID, attachmentFolderID, fileVO, inputStream, dataSource);
        }catch(CvFileException cfe){
View Full Code Here


        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(list1);

        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bais);

        TLinkedList list2 = (TLinkedList) ois.readObject();
        assertEquals(list1, list2);
    }
View Full Code Here

      String varName = varRef.getName();
      TVariableInfo varInfo = mgmtFacade.getVariableInfo(scopeId, varName).getVariableInfo();
      Object obj = varInfo.getValue()// actually an xml representation
      variables.put(varName,           // cheap tricks
          XmlToJson.parse(
              new ByteArrayInputStream(obj.toString().getBytes()
              )
          )
      );
    }
View Full Code Here

    }

    public static Document getAsDocument(String xmlString) throws SAXException,
            IOException, ParserConfigurationException {
        return newDocumentBuilder().parse(
                new ByteArrayInputStream(xmlString.getBytes()));
    }
View Full Code Here

    _state = state;
    _content = content;
  }

  public InputStream getContents() throws CoreException {
    return new ByteArrayInputStream(_content);
  }
View Full Code Here

            for (int i=foldersToCreate.size() - 1; i >= 0; i--) {
              foldersToCreate.get(i).create(false, true, new NullProgressMonitor());
            }           
            // create tml file           
                  String header = Plugin.getDefault().getHeaderFileMap().get(Plugin.HEADER_TML_MODUL).getHeaderForProject(fileToCreate.getProject())
                  fileToCreate.create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());             
            // open editor
            WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), fileToCreate, ResourceIDs.EDITOR_TML);
          } catch (CoreException e) {
          }       
        }
View Full Code Here

            }
            for (int i=foldersToCreate.size() - 1; i >= 0; i--) {
              foldersToCreate.get(i).create(false, true, new NullProgressMonitor());
            }           
            // create tml file
            fileToCreate.create(new ByteArrayInputStream(new byte[0]), true, new NullProgressMonitor());
            // open editor
            WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), fileToCreate);
          } catch (CoreException e) {
          }       
        }
View Full Code Here

                      "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

  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

  /* (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

TOP

Related Classes of java.io.ByteArrayInputStream

Copyright © 2018 www.massapicom. 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.