Package java.io

Examples of java.io.DataOutputStream.writeUTF()


        }
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
          DataOutputStream doc = new DataOutputStream(out);
          if (sessionCode != null) {
            doc.writeUTF(sessionCode);

          } else {
            doc.writeUTF("");
          }
          doc.writeInt(content.length);
View Full Code Here


          DataOutputStream doc = new DataOutputStream(out);
          if (sessionCode != null) {
            doc.writeUTF(sessionCode);

          } else {
            doc.writeUTF("");
          }
          doc.writeInt(content.length);
          doc.write(content);
        } catch (Exception e) {
          e.printStackTrace();
View Full Code Here

      try {
        out.write(MAGIC_NUMBER);
        out.writeByte(FILE_FORMAT_VERSION);

        for (Namespace ns : namespacesMap.values()) {
          out.writeUTF(ns.getName());
          out.writeUTF(ns.getPrefix());
        }
      }
      finally {
        out.close();
View Full Code Here

        out.write(MAGIC_NUMBER);
        out.writeByte(FILE_FORMAT_VERSION);

        for (Namespace ns : namespacesMap.values()) {
          out.writeUTF(ns.getName());
          out.writeUTF(ns.getPrefix());
        }
      }
      finally {
        out.close();
      }
View Full Code Here

         dataApi.delete(dataObjectNameIn);
         assertEquals(containerApi.get(containerName).getChildren().contains(dataObjectNameIn), false);

         // exercise create data object with byte array
         value = "Hello CDMI World 7";
         out.writeUTF(value);
         out.close();
         bytes = bos.toByteArray();
         // String.getBytes causes an exception CreateDataObjectOptions need to investigate byte
         // arrays
         // bytes = value.getBytes(Charsets.UTF_8);
View Full Code Here

            File lastModelFile = getLastModelFile();
            DataOutputStream out = new DataOutputStream(
                    new FileOutputStream(lastModelFile));
            out.writeBoolean(lastModelDir != null);
            if (lastModelDir != null) {
                out.writeUTF(lastModelDir.getAbsolutePath());
            }
            out.writeBoolean(compiledDir != null);
            if (compiledDir != null) {
                out.writeUTF(compiledDir.getAbsolutePath());
            }
View Full Code Here

            if (lastModelDir != null) {
                out.writeUTF(lastModelDir.getAbsolutePath());
            }
            out.writeBoolean(compiledDir != null);
            if (compiledDir != null) {
                out.writeUTF(compiledDir.getAbsolutePath());
            }
            out.close();
        } catch (IOException ex) {
            LOGGER.log(Level.SEVERE, null, ex);
        }
View Full Code Here

                while (iter.hasNext())
                {
                    InetAddress destination = iter.next();
                    CompactEndpointSerializationHelper.serialize(destination, dos);
                    String id = MessagingService.instance().addCallback(handler, message, destination);
                    dos.writeUTF(id);
                    if (logger.isDebugEnabled())
                        logger.debug("Adding FWD message to: " + destination + " with ID " + id);
                }
                message = message.withHeaderAdded(RowMutation.FORWARD_HEADER, bos.toByteArray());
                // send the combined message + forward headers
View Full Code Here

   
    static void checkFixedDelimited(String str) throws Exception
    {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream dout = new DataOutputStream(out);
        dout.writeUTF(str);
        dout.close();
       
        LinkedBuffer lb = new LinkedBuffer(512);
        WriteSession session = new WriteSession(lb);
        StringSerializer.writeUTF8FixedDelimited(str, session, lb);
View Full Code Here

   
    static void checkFixedDelimited(String str) throws Exception
    {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream dout = new DataOutputStream(out);
        dout.writeUTF(str);
        dout.close();
       
        LinkedBuffer lb = new LinkedBuffer(512);
        WriteSession session = new WriteSession(lb);
        StringSerializer.writeUTF8FixedDelimited(str, session, lb);
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.