Examples of StringInputStream


Examples of com.amazonaws.util.StringInputStream

            }
        }


            try {
                request.setContent(new StringInputStream(stringWriter.getBuffer().toString()));
                request.addHeader("Content-Length", Integer.toString(stringWriter.getBuffer().toString().getBytes().length));
                request.addHeader("Content-Type", "application/xml");
            } catch (UnsupportedEncodingException e) {
                throw new AmazonClientException("Unable to marshall request to XML", e);
            }
View Full Code Here

Examples of com.amazonaws.util.StringInputStream

            }
        }


            try {
                request.setContent(new StringInputStream(stringWriter.getBuffer().toString()));
                request.addHeader("Content-Length", Integer.toString(stringWriter.getBuffer().toString().getBytes().length));
                request.addHeader("Content-Type", "application/xml");
            } catch (UnsupportedEncodingException e) {
                throw new AmazonClientException("Unable to marshall request to XML", e);
            }
View Full Code Here

Examples of com.amazonaws.util.StringInputStream

            }
        }


            try {
                request.setContent(new StringInputStream(stringWriter.getBuffer().toString()));
                request.addHeader("Content-Length", Integer.toString(stringWriter.getBuffer().toString().getBytes().length));
                request.addHeader("Content-Type", "application/xml");
            } catch (UnsupportedEncodingException e) {
                throw new AmazonClientException("Unable to marshall request to XML", e);
            }
View Full Code Here

Examples of com.amazonaws.util.StringInputStream

            }
        }


            try {
                request.setContent(new StringInputStream(stringWriter.getBuffer().toString()));
                request.addHeader("Content-Length", Integer.toString(stringWriter.getBuffer().toString().getBytes().length));
                request.addHeader("Content-Type", "application/xml");
            } catch (UnsupportedEncodingException e) {
                throw new AmazonClientException("Unable to marshall request to XML", e);
            }
View Full Code Here

Examples of com.amazonaws.util.StringInputStream

          jsonWriter.endObject();
         

          String snippet = stringWriter.toString();
          byte[] content = snippet.getBytes("UTF-8");
          request.setContent(new StringInputStream(snippet));
          request.addHeader("Content-Length", Integer.toString(content.length));
        } catch(Throwable t) {
          throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
        }
       
View Full Code Here

Examples of com.sun.xml.bind.StringInputStream

          }
        }else{
          throw new RuntimeException("Invalid Operation name in query parameter.(Please pass valid opeartion name as query parameter)");
        }
      }
      return new StringInputStream(URLDecoder.decode(queryStringUpdated,System.getProperty("javaEncoding", "UTF-8")));
    }
  }
View Full Code Here

Examples of jodd.io.StringInputStream

   * @return
   * @throws Exception
   */
  public static InputStream byteTOFInputStream(byte[] in) throws Exception {

    InputStream is = new StringInputStream(InputStreamTOString(StreamUtils.byteTOInputStream(in)));
    return is;
  }
View Full Code Here

Examples of org.apache.tools.ant.filters.StringInputStream

    List<String> args = new ArrayList<String>();
    args.add(schema.toString());
    args.add("-");
    args.addAll(extra);
    new DataFileWriteTool().run(
        new StringInputStream(jsonData),
        new PrintStream(out), // stdout
        null, // stderr
        args);
    out.close();
    fout.close();
View Full Code Here

Examples of org.apache.tools.ant.filters.StringInputStream

  public void testFailureOnWritingPartialJSONValues() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintStream out = new PrintStream(baos);
    try {
      new DataFileWriteTool().run(
          new StringInputStream("{"),
          new PrintStream(out), // stdout
          null, // stderr
          Arrays.asList("{ \"type\":\"record\", \"fields\":" +
                        "[{\"name\":\"foo\", \"type\":\"string\"}], " +
                        "\"name\":\"boring\" }", "-"));
View Full Code Here

Examples of org.apache.tools.ant.filters.StringInputStream

    File outFile = AvroTestUtil.tempFile(
        TestDataFileTools.class + "." + testName + ".avro");
    FileOutputStream fout = new FileOutputStream(outFile);
    PrintStream out = new PrintStream(fout);
    new DataFileWriteTool().run(
        new StringInputStream(json),
        new PrintStream(out), // stdout
        null, // stderr
        Arrays.asList(schema, "-"));
    out.close();
    fout.close();
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.