Record Class GzipWriter
java.lang.Object
java.lang.Record
cool.scx.http.media.gzip.GzipWriter
- All Implemented Interfaces:
MediaWriter
-
Constructor Summary
ConstructorsConstructorDescriptionGzipWriter(MediaWriter mediaWriter) Creates an instance of aGzipWriterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongbeforeWrite(ScxHttpHeadersWritable responseHeaders, ScxHttpHeaders requestHeaders) 写入内容之前 在这里可以设置 header 头final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themediaWriterrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(OutputStream outputStream) 写入内容
-
Constructor Details
-
GzipWriter
Creates an instance of aGzipWriterrecord class.- Parameters:
mediaWriter- the value for themediaWriterrecord component
-
-
Method Details
-
beforeWrite
Description copied from interface:MediaWriter写入内容之前 在这里可以设置 header 头- Specified by:
beforeWritein interfaceMediaWriter- Parameters:
responseHeaders- 响应头 (在客户端状态下是 requestHeaders)requestHeaders- 请求头 (在客户端状态下是 空 Header)- Returns:
- 预期的内容长度 : (-1 未知长度, 0 无内容, 大于 0 标准长度)
-
write
Description copied from interface:MediaWriter写入内容- Specified by:
writein interfaceMediaWriter- Parameters:
outputStream- 输入流- Throws:
IOException
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
mediaWriter
Returns the value of themediaWriterrecord component.- Returns:
- the value of the
mediaWriterrecord component
-