27 cursor = (
char*)(img.getRawImage());
28 remaining = img.getRawImageSize();
29 }
else if (phase==3) {
32 remaining = blobHeader.blobLen;
37 while (phase==0 && delegate->getInputStream().isOk()) {
40 s = delegate->getInputStream().readLine();
42 }
while ((s.length()==0||s[0]!=
'-') && delegate->getInputStream().isOk());
43 s = delegate->getInputStream().readLine();
44 if (s!=
"Content-Type: image/jpeg") {
45 if (!delegate->getInputStream().isOk()) {
53 s = delegate->getInputStream().readLine();
57 if (!delegate->getInputStream().isOk()) {
66 s = delegate->getInputStream().readLine();
68 }
while (s.length()>0);
71 delegate->getInputStream().readFull(cimg.bytes());
72 if (!decompression.decompress(cimg.bytes(), img)) {
73 if (delegate->getInputStream().isOk()) {
77 imgHeader.setFromImage(img);
79 cursor = (
char*)(&imgHeader);
80 remaining =
sizeof(imgHeader);
88 cursor = (
char*)(&blobHeader);
89 remaining =
sizeof(blobHeader);
94 int allow = remaining;
95 if ((
int)b.
length()<allow) {
98 if (cursor!=
nullptr) {
99 memcpy(b.
get(),cursor,allow);
105 int result = delegate->getInputStream().read(b);
119 delegate->getOutputStream().write(b);