tstream

Http response: Cannot convert JSON into stream

最后都变了- 提交于 2020-05-16 07:13:06
问题 I have an API in JAVA to upload a zip file to a server in Delphi, and I am doing it as follows: DSRESTConnection conn = new DSRESTConnection(); conn.setHost("example.com"); conn.setPort(8080); TServerMethods1 proxy = new TServerMethods1(conn); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedOutputStream bos = new BufferedOutputStream(baos); ZipOutputStream zos = new ZipOutputStream(bos); zos.putNextEntry(new ZipEntry("test.json")); byte[] bytes = inputJson.getBytes();

Opening a TStream on stdin/stdout in a Delphi console app

扶醉桌前 提交于 2019-12-18 10:09:29
问题 I'm trying to write a Delphi console application that creates a TStream for its standard input, and another TStream for its standard output. (It will be launched by a host app with its input and output redirected to pipes, and will be passing binary data to/from that host app, so TStream will be much better-suited to the task than ReadLn/WriteLn.) How do I go about opening a TStream on standard input or standard output? 回答1: Off the top of my head: InputStream := THandleStream.Create

Opening a TStream on stdin/stdout in a Delphi console app

孤街醉人 提交于 2019-11-29 20:22:08
I'm trying to write a Delphi console application that creates a TStream for its standard input, and another TStream for its standard output. (It will be launched by a host app with its input and output redirected to pipes, and will be passing binary data to/from that host app, so TStream will be much better-suited to the task than ReadLn/WriteLn.) How do I go about opening a TStream on standard input or standard output? Allen Bauer Off the top of my head: InputStream := THandleStream.Create(GetStdHandle(STD_INPUT_HANDLE)); OutputStream := THandleStream.Create(GetStdHandle(STD_OUTPUT_HANDLE));