Go to the source code of this file.
◆ SkCopyStreamToData()
Copy the provided stream to an SkData variable.
Note: Assumes the stream is at the beginning. If it has a length, but is not at the beginning, this call will fail (return NULL).
- Parameters
-
- Returns
- The resulting SkData after the copy, nullptr on failure.
Definition at line 937 of file SkStream.cpp.
937 {
939
940 if (
stream->hasLength()) {
942 }
943
945 const size_t bufferSize = 4096;
947 do {
950 }
while (!
stream->isAtEnd());
952}
static sk_sp< SkData > MakeFromStream(SkStream *, size_t size)
bool write(const void *buffer, size_t size) override
sk_sp< SkData > detachAsData()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
◆ SkStreamCopy()
Copies the input stream from the current position to the end. Does not rewind the input stream.
Definition at line 954 of file SkStream.cpp.
954 {
957
962 }
963 char scratch[4096];
965 while (true) {
966 count = input->
read(scratch,
sizeof(scratch));
968 return true;
969 }
971 return false;
972 }
973 }
974}
virtual bool hasPosition() const
virtual size_t getPosition() const
virtual size_t getLength() const
virtual const void * getMemoryBase()
virtual bool hasLength() const
virtual size_t read(void *buffer, size_t size)=0
◆ SkWStreamWriteS32BE()
bool SkWStreamWriteS32BE |
( |
SkWStream * |
s, |
|
|
int32_t |
value |
|
) |
| |
|
inline |
Definition at line 59 of file SkStreamPriv.h.
59 {
62}
#define SkEndian_SwapBE32(n)
◆ SkWStreamWriteU16BE()
bool SkWStreamWriteU16BE |
( |
SkWStream * |
s, |
|
|
uint16_t |
value |
|
) |
| |
|
inline |
Helper functions to write big-endian values to a stream.
Definition at line 49 of file SkStreamPriv.h.
49 {
52}
#define SkEndian_SwapBE16(n)
◆ SkWStreamWriteU32BE()
bool SkWStreamWriteU32BE |
( |
SkWStream * |
s, |
|
|
uint32_t |
value |
|
) |
| |
|
inline |
◆ StreamRemainingLengthIsBelow()
bool StreamRemainingLengthIsBelow |
( |
SkStream * |
stream, |
|
|
size_t |
len |
|
) |
| |
Definition at line 976 of file SkStream.cpp.
976 {
978 if (
stream->hasLength()) {
979 if (
stream->hasPosition()) {
980 size_t remainingBytes =
stream->getLength() -
stream->getPosition();
981 return remainingBytes <
len;
982 }
983
984
986 }
987 return false;
988}