Package java.io

Examples of java.io.DataInputStream.readUTF()


                }
              });             
              return "";
            }
          }
          String responseBody = ds.readUTF();
          return "<pre>" + responseBody + "</pre>";
        } catch (HttpException e) {
          return e.getMessage();
        } catch (IOException e) {
          return e.getMessage();
View Full Code Here


          throw new IOException("Unable to read namespace file; invalid file format version: " + version);
        }

        while (true) {
          try {
            String name = in.readUTF();
            String prefix = in.readUTF();

            NamespaceImpl ns = new NamespaceImpl(prefix, name);
            namespacesMap.put(prefix, ns);
          }
View Full Code Here

        }

        while (true) {
          try {
            String name = in.readUTF();
            String prefix = in.readUTF();

            NamespaceImpl ns = new NamespaceImpl(prefix, name);
            namespacesMap.put(prefix, ns);
          }
          catch (EOFException e) {
View Full Code Here

            if (lastModelFile.exists()) {
                DataInputStream in = new DataInputStream(
                        new FileInputStream(lastModelFile));
                String str;
                if (in.readBoolean()) {
                    str = in.readUTF();
                    lastModelDir = new File(str);
                } else {
                    lastModelDir = null;
                }
View Full Code Here

                } else {
                    lastModelDir = null;
                }

                if (in.readBoolean()) {
                    str = in.readUTF();
                    compiledDir = new File(str);
                } else {
                    compiledDir = null;
                }
                in.close();
View Full Code Here

        Message messageCopy = message.withHeaderRemoved(RowMutation.FORWARD_HEADER);
        for (int i = 0; i < size; i++)
        {
            // Send a message to each of the addresses on our Forward List
            InetAddress address = CompactEndpointSerializationHelper.deserialize(dis);
            String id = dis.readUTF();
            if (logger_.isDebugEnabled())
                logger_.debug("Forwarding message to " + address + " with= ID: " + id);
            // Let the response go back to the coordinator
            MessagingService.instance().sendOneWay(messageCopy, id, address);
        }
View Full Code Here

      } else {
        // Presume it pre-pb format.
        InputStream is = new ByteArrayInputStream(content);
        DataInputStream dis = new DataInputStream(is);
        try {
          version = dis.readUTF();
        } finally {
          dis.close();
        }
        // Update the format
        LOG.info("Updating the hbase.version file format with version=" + version);
View Full Code Here

                    }
                }
                out.flush();
                out.close();
                DataInputStream in = new DataInputStream(new BufferedInputStream(con.getInputStream()));
                String status = in.readUTF();
                if(!status.equals("OK")) {
                    progress.fail("Unable to upload files to server: "+status);
                    return;
                }
                progress.updateStatus("File upload complete (Server: "+status+")");
View Full Code Here

                if(count != valid.size()) {
                    progress.fail("Server did not receive all "+valid.size()+" files ("+count+")");
                }
                for (Iterator it = valid.iterator(); it.hasNext();) {
                    Integer index = (Integer) it.next();
                    String serverFileName = in.readUTF();
                    files[index.intValue()] = new File(serverFileName);
                }
                in.close();
                progress.updateStatus(count+" file(s) transferred to server.  Resuming deployment operation.");
            } catch (Exception e) {
View Full Code Here

                final InputStream is = url.openStream();
                final BufferedInputStream bis = new BufferedInputStream(is);
                dis = new DataInputStream(bis);
                final int count = dis.readInt();
                for (int j = 0; j < count; ++j) {
                    final String type = dis.readUTF();
                    final int entries = dis.readInt();
                    ConcurrentMap<String, PluginType> types = map.get(type);
                    if (types == null) {
                        types = new ConcurrentHashMap<String, PluginType>(count);
                    }
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.