title: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag
body: <pre><code>  Configuration configuration = new Configuration();
  
    InputStream inputStream = new  BufferedInputStream(new FileInputStream("/home/acadgild/Desktop/pdtest"));
  
    FileSystem hdfs = FileSystem.get(new URI("hdfs://localhost:50070"), configuration);
  
    OutputStream outputStream = hdfs.create(new Path("hdfs://localhost:50070/pddata/new"),
    new Progressable() {  
            @Override
            public void progress() {
       System.out.println("Hello");
            }
                  });
    try
    {
      IOUtils.copyBytes(inputStream, outputStream, 4096, false); 
    }
    finally
    {
      IOUtils.closeStream(inputStream);
      IOUtils.closeStream(outputStream);
    } 
  </code></pre>
  
  <p>This is my snippet.  am very new to hadoop. I want to copy a file from my local file system to HDFS. The localSRC is correct. And In destination src, there is a folder pddata and new is the file I want to create and write the stuff of my local file system. Please tell where I am going wrong. In the console I am geting this </p>
  
  <pre><code>Exception in thread "main" java.io.IOException: Failed on local exception: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag.; Host Details : local host is: "localhost.localdomain/127.0.0.1"; destination host is: "localhost":50070; 
  at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:772)
  at org.apache.hadoop.ipc.Client.call(Client.java:1472)
  at org.apache.hadoop.ipc.Client.call(Client.java:1399)
  at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
  at com.sun.proxy.$Proxy9.create(Unknown Source)
  at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.create(ClientNamenodeProtocolTranslatorPB.java:295)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187)
  at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
  at com.sun.proxy.$Proxy10.create(Unknown Source)
  at org.apache.hadoop.hdfs.DFSOutputStream.newStreamForCreate(DFSOutputStream.java:1725)
  at org.apache.hadoop.hdfs.DFSClient.create(DFSClient.java:1668)
  at org.apache.hadoop.hdfs.DFSClient.create(DFSClient.java:1593)
  at org.apache.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.java:397)
  at org.apache.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.java:393)
  at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
  at org.apache.hadoop.hdfs.DistributedFileSystem.create(DistributedFileSystem.java:393)
  at org.apache.hadoop.hdfs.DistributedFileSystem.create(DistributedFileSystem.java:337)
  at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:908)
  at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:801)
  at CopyFileToHDFS.main(CopyFileToHDFS.java:25)
  </code></pre>